Commit eda97a92 authored by Balazs Engedy's avatar Balazs Engedy Committed by Commit Bot

Update WebAuthn UX strings with final-ish revisions.

Screenshots for strings will be uploaded in a follow-up CL.

This CL also improves the naming of some string constants, as well as deduplicates
the two USB activation sheets (register/sign) into just one.

Bug: 849323
Change-Id: I37709d65c6fe980dff18d1b98d070a66f4d90115
TBR: jcivelli@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/1178285Reviewed-by: default avatarJun Choi <hongjunchoi@chromium.org>
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583853}
parent ea3f82d0
This diff is collapsed.
......@@ -34,7 +34,7 @@ std::unique_ptr<AuthenticatorRequestSheetView> CreateSheetViewForCurrentStepOf(
std::unique_ptr<AuthenticatorRequestSheetView> sheet_view;
switch (dialog_model->current_step()) {
case Step::kInitial:
case Step::kWelcomeScreen:
sheet_view = std::make_unique<AuthenticatorRequestSheetView>(
std::make_unique<AuthenticatorInitialSheetModel>(dialog_model));
break;
......@@ -43,15 +43,9 @@ std::unique_ptr<AuthenticatorRequestSheetView> CreateSheetViewForCurrentStepOf(
std::make_unique<AuthenticatorTransportSelectorSheetModel>(
dialog_model));
break;
case Step::kUsbInsertAndActivateOnRegister:
case Step::kUsbInsertAndActivate:
sheet_view = std::make_unique<AuthenticatorRequestSheetView>(
std::make_unique<
AuthenticatorInsertAndActivateUsbOnRegisterSheetModel>(
dialog_model));
break;
case Step::kUsbInsertAndActivateOnSign:
sheet_view = std::make_unique<AuthenticatorRequestSheetView>(
std::make_unique<AuthenticatorInsertAndActivateUsbOnSignSheetModel>(
std::make_unique<AuthenticatorInsertAndActivateUsbSheetModel>(
dialog_model));
break;
case Step::kErrorTimedOut:
......
......@@ -34,12 +34,9 @@ class AuthenticatorDialogTest : public DialogBrowserTest {
AuthenticatorTransport::kCloudAssistedBluetoothLowEnergy);
model->SetCurrentStep(
AuthenticatorRequestDialogModel::Step::kTransportSelection);
} else if (name == "insert_usb_register") {
model->SetCurrentStep(AuthenticatorRequestDialogModel::Step::
kUsbInsertAndActivateOnRegister);
} else if (name == "insert_usb_sign") {
} else if (name == "activate_usb") {
model->SetCurrentStep(
AuthenticatorRequestDialogModel::Step::kUsbInsertAndActivateOnSign);
AuthenticatorRequestDialogModel::Step::kUsbInsertAndActivate);
} else if (name == "timeout") {
model->SetCurrentStep(
AuthenticatorRequestDialogModel::Step::kErrorTimedOut);
......@@ -91,11 +88,7 @@ IN_PROC_BROWSER_TEST_F(AuthenticatorDialogTest, InvokeUi_transports) {
ShowAndVerifyUi();
}
IN_PROC_BROWSER_TEST_F(AuthenticatorDialogTest, InvokeUi_insert_usb_register) {
ShowAndVerifyUi();
}
IN_PROC_BROWSER_TEST_F(AuthenticatorDialogTest, InvokeUi_insert_usb_sign) {
IN_PROC_BROWSER_TEST_F(AuthenticatorDialogTest, InvokeUi_activate_usb) {
ShowAndVerifyUi();
}
......
......@@ -90,12 +90,12 @@ base::string16 AuthenticatorInitialSheetModel::GetStepTitle() const {
// TODO(hongjunchoi): Insert actual domain name from model to
// |application_name|.
base::string16 application_name = base::UTF8ToUTF16("example.com");
return l10n_util::GetStringFUTF16(IDS_WEBAUTHN_INITIAL_SHEET_TITLE,
return l10n_util::GetStringFUTF16(IDS_WEBAUTHN_WELCOME_SCREEN_TITLE,
application_name);
}
base::string16 AuthenticatorInitialSheetModel::GetStepDescription() const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_INITIAL_SHEET_DESCRIPTION);
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_WELCOME_SCREEN_DESCRIPTION);
}
bool AuthenticatorInitialSheetModel::IsAcceptButtonVisible() const {
......@@ -107,14 +107,14 @@ bool AuthenticatorInitialSheetModel::IsAcceptButtonEnabled() const {
}
base::string16 AuthenticatorInitialSheetModel::GetAcceptButtonLabel() const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_INITIAL_SHEET_NEXT);
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_WELCOME_SCREEN_NEXT);
}
void AuthenticatorInitialSheetModel::OnAccept() {
// TODO(hongjunchoi): Check whether Bluetooth adapter is enabled and if it is,
// set current step to |kTransportSelection|.
dialog_model()->SetCurrentStep(
AuthenticatorRequestDialogModel::Step::kUsbInsertAndActivateOnRegister);
AuthenticatorRequestDialogModel::Step::kUsbInsertAndActivate);
}
// AuthenticatorTransportSelectorSheetModel -----------------------------------
......@@ -143,44 +143,25 @@ void AuthenticatorTransportSelectorSheetModel::OnTransportSelected(
dialog_model()->StartGuidedFlowForTransport(transport);
}
// AuthenticatorInsertAndActivateUsbOnRegisterSheetModel ----------------------
// AuthenticatorInsertAndActivateUsbSheetModel ----------------------
gfx::ImageSkia*
AuthenticatorInsertAndActivateUsbOnRegisterSheetModel::GetStepIllustration()
const {
AuthenticatorInsertAndActivateUsbSheetModel::GetStepIllustration() const {
return GetImage(IDR_WEBAUTHN_ILLUSTRATION_USB_1X);
}
base::string16
AuthenticatorInsertAndActivateUsbOnRegisterSheetModel::GetStepTitle() const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_USB_TITLE_ON_REGISTER);
}
base::string16
AuthenticatorInsertAndActivateUsbOnRegisterSheetModel::GetStepDescription()
const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_USB_INSERT_DESCRIPTION);
}
// AuthenticatorInsertAndActivateUsbOnSignSheetModel ----------------------
gfx::ImageSkia*
AuthenticatorInsertAndActivateUsbOnSignSheetModel::GetStepIllustration() const {
return GetImage(IDR_WEBAUTHN_ILLUSTRATION_USB_1X);
}
base::string16 AuthenticatorInsertAndActivateUsbOnSignSheetModel::GetStepTitle()
base::string16 AuthenticatorInsertAndActivateUsbSheetModel::GetStepTitle()
const {
// TODO(hongjunchoi): Insert actual domain name from model to
// |application_name|.
base::string16 application_name = base::UTF8ToUTF16("example.com");
return l10n_util::GetStringFUTF16(IDS_WEBAUTHN_USB_TITLE_ON_SIGNIN,
return l10n_util::GetStringFUTF16(IDS_WEBAUTHN_GENERIC_TITLE,
application_name);
}
base::string16
AuthenticatorInsertAndActivateUsbOnSignSheetModel::GetStepDescription() const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_USB_INSERT_DESCRIPTION);
base::string16 AuthenticatorInsertAndActivateUsbSheetModel::GetStepDescription()
const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_USB_ACTIVATE_DESCRIPTION);
}
// AuthenticatorTimeoutErrorModel ---------------------------------------------
......@@ -190,11 +171,11 @@ gfx::ImageSkia* AuthenticatorTimeoutErrorModel::GetStepIllustration() const {
}
base::string16 AuthenticatorTimeoutErrorModel::GetStepTitle() const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_TIMEOUT_TITLE);
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_ERROR_GENERIC_TITLE);
}
base::string16 AuthenticatorTimeoutErrorModel::GetStepDescription() const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_TIMEOUT_DESCRIPTION);
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_ERROR_TIMEOUT_DESCRIPTION);
}
// AuthenticatorBlePowerOnManualSheetModel ------------------------------------
......@@ -205,13 +186,14 @@ gfx::ImageSkia* AuthenticatorBlePowerOnManualSheetModel::GetStepIllustration()
}
base::string16 AuthenticatorBlePowerOnManualSheetModel::GetStepTitle() const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_BLE_POWER_ON_MANUAL_TITLE);
return l10n_util::GetStringUTF16(
IDS_WEBAUTHN_BLUETOOTH_POWER_ON_MANUAL_TITLE);
}
base::string16 AuthenticatorBlePowerOnManualSheetModel::GetStepDescription()
const {
return l10n_util::GetStringUTF16(
IDS_WEBAUTHN_BLE_POWER_ON_MANUAL_DESCRIPTION);
IDS_WEBAUTHN_BLUETOOTH_POWER_ON_MANUAL_DESCRIPTION);
}
bool AuthenticatorBlePowerOnManualSheetModel::IsAcceptButtonVisible() const {
......@@ -224,7 +206,7 @@ bool AuthenticatorBlePowerOnManualSheetModel::IsAcceptButtonEnabled() const {
base::string16 AuthenticatorBlePowerOnManualSheetModel::GetAcceptButtonLabel()
const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_BLE_POWER_ON_MANUAL_TRY_AGAIN);
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_BLUETOOTH_POWER_ON_MANUAL_NEXT);
}
// AuthenticatorBlePairingBeginSheetModel -------------------------------------
......@@ -253,7 +235,7 @@ bool AuthenticatorBlePairingBeginSheetModel::IsAcceptButtonEnabled() const {
base::string16 AuthenticatorBlePairingBeginSheetModel::GetAcceptButtonLabel()
const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_BLE_PAIRING_BEGIN_START);
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_BLE_PAIRING_BEGIN_NEXT);
}
// AuthenticatorBleEnterPairingModeSheetModel ---------------------------------
......@@ -265,7 +247,11 @@ AuthenticatorBleEnterPairingModeSheetModel::GetStepIllustration() const {
base::string16 AuthenticatorBleEnterPairingModeSheetModel::GetStepTitle()
const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_BLE_ENTER_PAIRING_MODE_TITLE);
// TODO(hongjunchoi): Insert actual domain name from model to
// |application_name|.
base::string16 application_name = base::UTF8ToUTF16("example.com");
return l10n_util::GetStringFUTF16(IDS_WEBAUTHN_GENERIC_TITLE,
application_name);
}
base::string16 AuthenticatorBleEnterPairingModeSheetModel::GetStepDescription()
......@@ -348,7 +334,7 @@ base::string16 AuthenticatorBleActivateSheetModel::GetStepTitle() const {
// TODO(hongjunchoi): Insert actual domain name from model to
// |application_name|.
base::string16 application_name = base::UTF8ToUTF16("example.com");
return l10n_util::GetStringFUTF16(IDS_WEBAUTHN_BLE_ACTIVATE_TITLE,
return l10n_util::GetStringFUTF16(IDS_WEBAUTHN_GENERIC_TITLE,
application_name);
}
......
......@@ -83,19 +83,7 @@ class AuthenticatorTransportSelectorSheetModel
base::string16 GetStepDescription() const override;
};
class AuthenticatorInsertAndActivateUsbOnRegisterSheetModel
: public AuthenticatorSheetModelBase {
public:
using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase;
private:
// AuthenticatorSheetModelBase:
gfx::ImageSkia* GetStepIllustration() const override;
base::string16 GetStepTitle() const override;
base::string16 GetStepDescription() const override;
};
class AuthenticatorInsertAndActivateUsbOnSignSheetModel
class AuthenticatorInsertAndActivateUsbSheetModel
: public AuthenticatorSheetModelBase {
public:
using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase;
......
......@@ -37,7 +37,7 @@ void AuthenticatorRequestDialogModel::StartGuidedFlowForTransport(
DCHECK_EQ(current_step(), Step::kTransportSelection);
switch (transport) {
case AuthenticatorTransport::kUsb:
SetCurrentStep(Step::kUsbInsertAndActivateOnRegister);
SetCurrentStep(Step::kUsbInsertAndActivate);
break;
case AuthenticatorTransport::kBluetoothLowEnergy:
SetCurrentStep(Step::kBlePowerOnManual);
......@@ -73,7 +73,7 @@ void AuthenticatorRequestDialogModel::FinishPairingWithPin(
}
void AuthenticatorRequestDialogModel::TryUsbDevice() {
DCHECK_EQ(current_step(), Step::kUsbInsertAndActivateOnRegister);
DCHECK_EQ(current_step(), Step::kUsbInsertAndActivate);
}
void AuthenticatorRequestDialogModel::TryTouchId() {
......@@ -86,10 +86,10 @@ void AuthenticatorRequestDialogModel::Cancel() {
}
void AuthenticatorRequestDialogModel::Back() {
if (current_step() == Step::kInitial) {
if (current_step() == Step::kWelcomeScreen) {
Cancel();
} else {
SetCurrentStep(Step::kInitial);
SetCurrentStep(Step::kWelcomeScreen);
}
}
......
......@@ -24,14 +24,13 @@ class AuthenticatorRequestDialogModel {
public:
// Defines the potential steps of the Web Authentication API request UX flow.
enum class Step {
kInitial,
kWelcomeScreen,
kTransportSelection,
kErrorTimedOut,
kCompleted,
// Universal Serial Bus (USB).
kUsbInsertAndActivateOnRegister,
kUsbInsertAndActivateOnSign,
kUsbInsertAndActivate,
// Bluetooth Low Energy (BLE).
kBlePowerOnAutomatic,
......@@ -159,7 +158,7 @@ class AuthenticatorRequestDialogModel {
private:
// The current step of the request UX flow that is currently shown.
Step current_step_ = Step::kInitial;
Step current_step_ = Step::kWelcomeScreen;
TransportListModel transport_list_model_;
base::ObserverList<Observer> observers_;
......
......@@ -81,8 +81,8 @@ void SetInitialUiModelBasedOnPreviouslyUsedTransport(
// TouchID transports.
switch (*previous_transport) {
case device::FidoTransportProtocol::kUsbHumanInterfaceDevice:
model->SetCurrentStep(AuthenticatorRequestDialogModel::Step::
kUsbInsertAndActivateOnRegister);
model->SetCurrentStep(
AuthenticatorRequestDialogModel::Step::kUsbInsertAndActivate);
break;
default:
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment