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( ...@@ -34,7 +34,7 @@ std::unique_ptr<AuthenticatorRequestSheetView> CreateSheetViewForCurrentStepOf(
std::unique_ptr<AuthenticatorRequestSheetView> sheet_view; std::unique_ptr<AuthenticatorRequestSheetView> sheet_view;
switch (dialog_model->current_step()) { switch (dialog_model->current_step()) {
case Step::kInitial: case Step::kWelcomeScreen:
sheet_view = std::make_unique<AuthenticatorRequestSheetView>( sheet_view = std::make_unique<AuthenticatorRequestSheetView>(
std::make_unique<AuthenticatorInitialSheetModel>(dialog_model)); std::make_unique<AuthenticatorInitialSheetModel>(dialog_model));
break; break;
...@@ -43,15 +43,9 @@ std::unique_ptr<AuthenticatorRequestSheetView> CreateSheetViewForCurrentStepOf( ...@@ -43,15 +43,9 @@ std::unique_ptr<AuthenticatorRequestSheetView> CreateSheetViewForCurrentStepOf(
std::make_unique<AuthenticatorTransportSelectorSheetModel>( std::make_unique<AuthenticatorTransportSelectorSheetModel>(
dialog_model)); dialog_model));
break; break;
case Step::kUsbInsertAndActivateOnRegister: case Step::kUsbInsertAndActivate:
sheet_view = std::make_unique<AuthenticatorRequestSheetView>( sheet_view = std::make_unique<AuthenticatorRequestSheetView>(
std::make_unique< std::make_unique<AuthenticatorInsertAndActivateUsbSheetModel>(
AuthenticatorInsertAndActivateUsbOnRegisterSheetModel>(
dialog_model));
break;
case Step::kUsbInsertAndActivateOnSign:
sheet_view = std::make_unique<AuthenticatorRequestSheetView>(
std::make_unique<AuthenticatorInsertAndActivateUsbOnSignSheetModel>(
dialog_model)); dialog_model));
break; break;
case Step::kErrorTimedOut: case Step::kErrorTimedOut:
......
...@@ -34,12 +34,9 @@ class AuthenticatorDialogTest : public DialogBrowserTest { ...@@ -34,12 +34,9 @@ class AuthenticatorDialogTest : public DialogBrowserTest {
AuthenticatorTransport::kCloudAssistedBluetoothLowEnergy); AuthenticatorTransport::kCloudAssistedBluetoothLowEnergy);
model->SetCurrentStep( model->SetCurrentStep(
AuthenticatorRequestDialogModel::Step::kTransportSelection); AuthenticatorRequestDialogModel::Step::kTransportSelection);
} else if (name == "insert_usb_register") { } else if (name == "activate_usb") {
model->SetCurrentStep(AuthenticatorRequestDialogModel::Step::
kUsbInsertAndActivateOnRegister);
} else if (name == "insert_usb_sign") {
model->SetCurrentStep( model->SetCurrentStep(
AuthenticatorRequestDialogModel::Step::kUsbInsertAndActivateOnSign); AuthenticatorRequestDialogModel::Step::kUsbInsertAndActivate);
} else if (name == "timeout") { } else if (name == "timeout") {
model->SetCurrentStep( model->SetCurrentStep(
AuthenticatorRequestDialogModel::Step::kErrorTimedOut); AuthenticatorRequestDialogModel::Step::kErrorTimedOut);
...@@ -91,11 +88,7 @@ IN_PROC_BROWSER_TEST_F(AuthenticatorDialogTest, InvokeUi_transports) { ...@@ -91,11 +88,7 @@ IN_PROC_BROWSER_TEST_F(AuthenticatorDialogTest, InvokeUi_transports) {
ShowAndVerifyUi(); ShowAndVerifyUi();
} }
IN_PROC_BROWSER_TEST_F(AuthenticatorDialogTest, InvokeUi_insert_usb_register) { IN_PROC_BROWSER_TEST_F(AuthenticatorDialogTest, InvokeUi_activate_usb) {
ShowAndVerifyUi();
}
IN_PROC_BROWSER_TEST_F(AuthenticatorDialogTest, InvokeUi_insert_usb_sign) {
ShowAndVerifyUi(); ShowAndVerifyUi();
} }
......
...@@ -90,12 +90,12 @@ base::string16 AuthenticatorInitialSheetModel::GetStepTitle() const { ...@@ -90,12 +90,12 @@ base::string16 AuthenticatorInitialSheetModel::GetStepTitle() const {
// TODO(hongjunchoi): Insert actual domain name from model to // TODO(hongjunchoi): Insert actual domain name from model to
// |application_name|. // |application_name|.
base::string16 application_name = base::UTF8ToUTF16("example.com"); 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); application_name);
} }
base::string16 AuthenticatorInitialSheetModel::GetStepDescription() const { 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 { bool AuthenticatorInitialSheetModel::IsAcceptButtonVisible() const {
...@@ -107,14 +107,14 @@ bool AuthenticatorInitialSheetModel::IsAcceptButtonEnabled() const { ...@@ -107,14 +107,14 @@ bool AuthenticatorInitialSheetModel::IsAcceptButtonEnabled() const {
} }
base::string16 AuthenticatorInitialSheetModel::GetAcceptButtonLabel() 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() { void AuthenticatorInitialSheetModel::OnAccept() {
// TODO(hongjunchoi): Check whether Bluetooth adapter is enabled and if it is, // TODO(hongjunchoi): Check whether Bluetooth adapter is enabled and if it is,
// set current step to |kTransportSelection|. // set current step to |kTransportSelection|.
dialog_model()->SetCurrentStep( dialog_model()->SetCurrentStep(
AuthenticatorRequestDialogModel::Step::kUsbInsertAndActivateOnRegister); AuthenticatorRequestDialogModel::Step::kUsbInsertAndActivate);
} }
// AuthenticatorTransportSelectorSheetModel ----------------------------------- // AuthenticatorTransportSelectorSheetModel -----------------------------------
...@@ -143,44 +143,25 @@ void AuthenticatorTransportSelectorSheetModel::OnTransportSelected( ...@@ -143,44 +143,25 @@ void AuthenticatorTransportSelectorSheetModel::OnTransportSelected(
dialog_model()->StartGuidedFlowForTransport(transport); dialog_model()->StartGuidedFlowForTransport(transport);
} }
// AuthenticatorInsertAndActivateUsbOnRegisterSheetModel ---------------------- // AuthenticatorInsertAndActivateUsbSheetModel ----------------------
gfx::ImageSkia* gfx::ImageSkia*
AuthenticatorInsertAndActivateUsbOnRegisterSheetModel::GetStepIllustration() AuthenticatorInsertAndActivateUsbSheetModel::GetStepIllustration() const {
const {
return GetImage(IDR_WEBAUTHN_ILLUSTRATION_USB_1X); return GetImage(IDR_WEBAUTHN_ILLUSTRATION_USB_1X);
} }
base::string16 base::string16 AuthenticatorInsertAndActivateUsbSheetModel::GetStepTitle()
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()
const { const {
// TODO(hongjunchoi): Insert actual domain name from model to // TODO(hongjunchoi): Insert actual domain name from model to
// |application_name|. // |application_name|.
base::string16 application_name = base::UTF8ToUTF16("example.com"); 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); application_name);
} }
base::string16 base::string16 AuthenticatorInsertAndActivateUsbSheetModel::GetStepDescription()
AuthenticatorInsertAndActivateUsbOnSignSheetModel::GetStepDescription() const { const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_USB_INSERT_DESCRIPTION); return l10n_util::GetStringUTF16(IDS_WEBAUTHN_USB_ACTIVATE_DESCRIPTION);
} }
// AuthenticatorTimeoutErrorModel --------------------------------------------- // AuthenticatorTimeoutErrorModel ---------------------------------------------
...@@ -190,11 +171,11 @@ gfx::ImageSkia* AuthenticatorTimeoutErrorModel::GetStepIllustration() const { ...@@ -190,11 +171,11 @@ gfx::ImageSkia* AuthenticatorTimeoutErrorModel::GetStepIllustration() const {
} }
base::string16 AuthenticatorTimeoutErrorModel::GetStepTitle() 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 { base::string16 AuthenticatorTimeoutErrorModel::GetStepDescription() const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_TIMEOUT_DESCRIPTION); return l10n_util::GetStringUTF16(IDS_WEBAUTHN_ERROR_TIMEOUT_DESCRIPTION);
} }
// AuthenticatorBlePowerOnManualSheetModel ------------------------------------ // AuthenticatorBlePowerOnManualSheetModel ------------------------------------
...@@ -205,13 +186,14 @@ gfx::ImageSkia* AuthenticatorBlePowerOnManualSheetModel::GetStepIllustration() ...@@ -205,13 +186,14 @@ gfx::ImageSkia* AuthenticatorBlePowerOnManualSheetModel::GetStepIllustration()
} }
base::string16 AuthenticatorBlePowerOnManualSheetModel::GetStepTitle() const { 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() base::string16 AuthenticatorBlePowerOnManualSheetModel::GetStepDescription()
const { const {
return l10n_util::GetStringUTF16( return l10n_util::GetStringUTF16(
IDS_WEBAUTHN_BLE_POWER_ON_MANUAL_DESCRIPTION); IDS_WEBAUTHN_BLUETOOTH_POWER_ON_MANUAL_DESCRIPTION);
} }
bool AuthenticatorBlePowerOnManualSheetModel::IsAcceptButtonVisible() const { bool AuthenticatorBlePowerOnManualSheetModel::IsAcceptButtonVisible() const {
...@@ -224,7 +206,7 @@ bool AuthenticatorBlePowerOnManualSheetModel::IsAcceptButtonEnabled() const { ...@@ -224,7 +206,7 @@ bool AuthenticatorBlePowerOnManualSheetModel::IsAcceptButtonEnabled() const {
base::string16 AuthenticatorBlePowerOnManualSheetModel::GetAcceptButtonLabel() base::string16 AuthenticatorBlePowerOnManualSheetModel::GetAcceptButtonLabel()
const { 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 ------------------------------------- // AuthenticatorBlePairingBeginSheetModel -------------------------------------
...@@ -253,7 +235,7 @@ bool AuthenticatorBlePairingBeginSheetModel::IsAcceptButtonEnabled() const { ...@@ -253,7 +235,7 @@ bool AuthenticatorBlePairingBeginSheetModel::IsAcceptButtonEnabled() const {
base::string16 AuthenticatorBlePairingBeginSheetModel::GetAcceptButtonLabel() base::string16 AuthenticatorBlePairingBeginSheetModel::GetAcceptButtonLabel()
const { const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_BLE_PAIRING_BEGIN_START); return l10n_util::GetStringUTF16(IDS_WEBAUTHN_BLE_PAIRING_BEGIN_NEXT);
} }
// AuthenticatorBleEnterPairingModeSheetModel --------------------------------- // AuthenticatorBleEnterPairingModeSheetModel ---------------------------------
...@@ -265,7 +247,11 @@ AuthenticatorBleEnterPairingModeSheetModel::GetStepIllustration() const { ...@@ -265,7 +247,11 @@ AuthenticatorBleEnterPairingModeSheetModel::GetStepIllustration() const {
base::string16 AuthenticatorBleEnterPairingModeSheetModel::GetStepTitle() base::string16 AuthenticatorBleEnterPairingModeSheetModel::GetStepTitle()
const { 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() base::string16 AuthenticatorBleEnterPairingModeSheetModel::GetStepDescription()
...@@ -348,7 +334,7 @@ base::string16 AuthenticatorBleActivateSheetModel::GetStepTitle() const { ...@@ -348,7 +334,7 @@ base::string16 AuthenticatorBleActivateSheetModel::GetStepTitle() const {
// TODO(hongjunchoi): Insert actual domain name from model to // TODO(hongjunchoi): Insert actual domain name from model to
// |application_name|. // |application_name|.
base::string16 application_name = base::UTF8ToUTF16("example.com"); 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); application_name);
} }
......
...@@ -83,19 +83,7 @@ class AuthenticatorTransportSelectorSheetModel ...@@ -83,19 +83,7 @@ class AuthenticatorTransportSelectorSheetModel
base::string16 GetStepDescription() const override; base::string16 GetStepDescription() const override;
}; };
class AuthenticatorInsertAndActivateUsbOnRegisterSheetModel class AuthenticatorInsertAndActivateUsbSheetModel
: 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
: public AuthenticatorSheetModelBase { : public AuthenticatorSheetModelBase {
public: public:
using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase; using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase;
......
...@@ -37,7 +37,7 @@ void AuthenticatorRequestDialogModel::StartGuidedFlowForTransport( ...@@ -37,7 +37,7 @@ void AuthenticatorRequestDialogModel::StartGuidedFlowForTransport(
DCHECK_EQ(current_step(), Step::kTransportSelection); DCHECK_EQ(current_step(), Step::kTransportSelection);
switch (transport) { switch (transport) {
case AuthenticatorTransport::kUsb: case AuthenticatorTransport::kUsb:
SetCurrentStep(Step::kUsbInsertAndActivateOnRegister); SetCurrentStep(Step::kUsbInsertAndActivate);
break; break;
case AuthenticatorTransport::kBluetoothLowEnergy: case AuthenticatorTransport::kBluetoothLowEnergy:
SetCurrentStep(Step::kBlePowerOnManual); SetCurrentStep(Step::kBlePowerOnManual);
...@@ -73,7 +73,7 @@ void AuthenticatorRequestDialogModel::FinishPairingWithPin( ...@@ -73,7 +73,7 @@ void AuthenticatorRequestDialogModel::FinishPairingWithPin(
} }
void AuthenticatorRequestDialogModel::TryUsbDevice() { void AuthenticatorRequestDialogModel::TryUsbDevice() {
DCHECK_EQ(current_step(), Step::kUsbInsertAndActivateOnRegister); DCHECK_EQ(current_step(), Step::kUsbInsertAndActivate);
} }
void AuthenticatorRequestDialogModel::TryTouchId() { void AuthenticatorRequestDialogModel::TryTouchId() {
...@@ -86,10 +86,10 @@ void AuthenticatorRequestDialogModel::Cancel() { ...@@ -86,10 +86,10 @@ void AuthenticatorRequestDialogModel::Cancel() {
} }
void AuthenticatorRequestDialogModel::Back() { void AuthenticatorRequestDialogModel::Back() {
if (current_step() == Step::kInitial) { if (current_step() == Step::kWelcomeScreen) {
Cancel(); Cancel();
} else { } else {
SetCurrentStep(Step::kInitial); SetCurrentStep(Step::kWelcomeScreen);
} }
} }
......
...@@ -24,14 +24,13 @@ class AuthenticatorRequestDialogModel { ...@@ -24,14 +24,13 @@ class AuthenticatorRequestDialogModel {
public: public:
// Defines the potential steps of the Web Authentication API request UX flow. // Defines the potential steps of the Web Authentication API request UX flow.
enum class Step { enum class Step {
kInitial, kWelcomeScreen,
kTransportSelection, kTransportSelection,
kErrorTimedOut, kErrorTimedOut,
kCompleted, kCompleted,
// Universal Serial Bus (USB). // Universal Serial Bus (USB).
kUsbInsertAndActivateOnRegister, kUsbInsertAndActivate,
kUsbInsertAndActivateOnSign,
// Bluetooth Low Energy (BLE). // Bluetooth Low Energy (BLE).
kBlePowerOnAutomatic, kBlePowerOnAutomatic,
...@@ -159,7 +158,7 @@ class AuthenticatorRequestDialogModel { ...@@ -159,7 +158,7 @@ class AuthenticatorRequestDialogModel {
private: private:
// The current step of the request UX flow that is currently shown. // 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_; TransportListModel transport_list_model_;
base::ObserverList<Observer> observers_; base::ObserverList<Observer> observers_;
......
...@@ -81,8 +81,8 @@ void SetInitialUiModelBasedOnPreviouslyUsedTransport( ...@@ -81,8 +81,8 @@ void SetInitialUiModelBasedOnPreviouslyUsedTransport(
// TouchID transports. // TouchID transports.
switch (*previous_transport) { switch (*previous_transport) {
case device::FidoTransportProtocol::kUsbHumanInterfaceDevice: case device::FidoTransportProtocol::kUsbHumanInterfaceDevice:
model->SetCurrentStep(AuthenticatorRequestDialogModel::Step:: model->SetCurrentStep(
kUsbInsertAndActivateOnRegister); AuthenticatorRequestDialogModel::Step::kUsbInsertAndActivate);
break; break;
default: default:
return; 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