Commit c3bc3de7 authored by Jun Choi's avatar Jun Choi Committed by Commit Bot

Add Phone as a security key sheet view

Add sheet view to show when prompting users to use their phone as a
security key to authenticate via the WebAuthN API.

Bug: 847985
Change-Id: I0bb605bf470456f5f29111834f69a71abfbe0430
Reviewed-on: https://chromium-review.googlesource.com/1177445
Commit-Queue: Jun Choi <hongjunchoi@chromium.org>
Reviewed-by: default avatarBalazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#583892}
parent 89a6d413
...@@ -9177,6 +9177,12 @@ Please help our engineers fix this problem. Tell us what happened right before y ...@@ -9177,6 +9177,12 @@ Please help our engineers fix this problem. Tell us what happened right before y
<message name="IDS_WEBAUTHN_TRANSPORT_POPUP_CABLE" desc="Menu item text. The user selects this to verify their identity on a web site (i.e. sign in) using their phone. They wirelessly connect their phone to their computer over Bluetooth Low Energy, and then use the phone to sign in to web sites on their computer."> <message name="IDS_WEBAUTHN_TRANSPORT_POPUP_CABLE" desc="Menu item text. The user selects this to verify their identity on a web site (i.e. sign in) using their phone. They wirelessly connect their phone to their computer over Bluetooth Low Energy, and then use the phone to sign in to web sites on their computer.">
Verify via your phone Verify via your phone
</message> </message>
<message name="IDS_WEBAUTHN_CABLE_ACTIVATE_TITLE" desc="Title of the dialog shown when the user tries to sign-in using a phone as a security key.">
Check your phone
</message>
<message name="IDS_WEBAUTHN_CABLE_ACTIVATE_DESCRIPTION" desc="Contents of the dialog shown when the user tries to sign-in using a phone as a security key.">
A notification was sent to your phone. Follow the prompts to confirm it's you.
</message>
</if> </if>
<if expr="is_macosx"> <if expr="is_macosx">
<message name="IDS_WEBAUTHN_TOUCH_ID_TITLE" desc="Title of the dialog shown when the user tries to sign in with Touch ID." meaning="'Touch ID' is the fingerprint recognition feature in macOS. Try to refer Apple support documentation in the target language for the appropriate product name translation."> <message name="IDS_WEBAUTHN_TOUCH_ID_TITLE" desc="Title of the dialog shown when the user tries to sign in with Touch ID." meaning="'Touch ID' is the fingerprint recognition feature in macOS. Try to refer Apple support documentation in the target language for the appropriate product name translation.">
......
...@@ -88,6 +88,10 @@ std::unique_ptr<AuthenticatorRequestSheetView> CreateSheetViewForCurrentStepOf( ...@@ -88,6 +88,10 @@ std::unique_ptr<AuthenticatorRequestSheetView> CreateSheetViewForCurrentStepOf(
sheet_view = std::make_unique<AuthenticatorRequestSheetView>( sheet_view = std::make_unique<AuthenticatorRequestSheetView>(
std::make_unique<AuthenticatorTouchIdSheetModel>(dialog_model)); std::make_unique<AuthenticatorTouchIdSheetModel>(dialog_model));
break; break;
case Step::kCableActivate:
sheet_view = std::make_unique<AuthenticatorRequestSheetView>(
std::make_unique<AuthenticatorPaaskSheetModel>(dialog_model));
break;
case Step::kCompleted: case Step::kCompleted:
case Step::kBlePowerOnAutomatic: case Step::kBlePowerOnAutomatic:
sheet_view = std::make_unique<AuthenticatorRequestSheetView>( sheet_view = std::make_unique<AuthenticatorRequestSheetView>(
......
...@@ -63,6 +63,9 @@ class AuthenticatorDialogTest : public DialogBrowserTest { ...@@ -63,6 +63,9 @@ class AuthenticatorDialogTest : public DialogBrowserTest {
AuthenticatorRequestDialogModel::Step::kBleActivate); AuthenticatorRequestDialogModel::Step::kBleActivate);
} else if (name == "touchid") { } else if (name == "touchid") {
model->SetCurrentStep(AuthenticatorRequestDialogModel::Step::kTouchId); model->SetCurrentStep(AuthenticatorRequestDialogModel::Step::kTouchId);
} else if (name == "cable_activate") {
model->SetCurrentStep(
AuthenticatorRequestDialogModel::Step::kCableActivate);
} }
ShowAuthenticatorRequestDialog( ShowAuthenticatorRequestDialog(
...@@ -128,3 +131,7 @@ IN_PROC_BROWSER_TEST_F(AuthenticatorDialogTest, InvokeUi_ble_activate) { ...@@ -128,3 +131,7 @@ IN_PROC_BROWSER_TEST_F(AuthenticatorDialogTest, InvokeUi_ble_activate) {
IN_PROC_BROWSER_TEST_F(AuthenticatorDialogTest, InvokeUi_touchid) { IN_PROC_BROWSER_TEST_F(AuthenticatorDialogTest, InvokeUi_touchid) {
ShowAndVerifyUi(); ShowAndVerifyUi();
} }
IN_PROC_BROWSER_TEST_F(AuthenticatorDialogTest, InvokeUi_cable_activate) {
ShowAndVerifyUi();
}
...@@ -368,3 +368,17 @@ base::string16 AuthenticatorTouchIdSheetModel::GetStepTitle() const { ...@@ -368,3 +368,17 @@ base::string16 AuthenticatorTouchIdSheetModel::GetStepTitle() const {
base::string16 AuthenticatorTouchIdSheetModel::GetStepDescription() const { base::string16 AuthenticatorTouchIdSheetModel::GetStepDescription() const {
return base::string16(); return base::string16();
} }
// AuthenticatorPaaskSheetModel -----------------------------------------
gfx::ImageSkia* AuthenticatorPaaskSheetModel::GetStepIllustration() const {
return GetImage(IDR_WEBAUTHN_ILLUSTRATION_PHONE_1X);
}
base::string16 AuthenticatorPaaskSheetModel::GetStepTitle() const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_CABLE_ACTIVATE_TITLE);
}
base::string16 AuthenticatorPaaskSheetModel::GetStepDescription() const {
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_CABLE_ACTIVATE_DESCRIPTION);
}
...@@ -207,4 +207,15 @@ class AuthenticatorTouchIdSheetModel : public AuthenticatorSheetModelBase { ...@@ -207,4 +207,15 @@ class AuthenticatorTouchIdSheetModel : public AuthenticatorSheetModelBase {
base::string16 GetStepDescription() const override; base::string16 GetStepDescription() const override;
}; };
class AuthenticatorPaaskSheetModel : public AuthenticatorSheetModelBase {
public:
using AuthenticatorSheetModelBase::AuthenticatorSheetModelBase;
private:
// AuthenticatorSheetModelBase:
gfx::ImageSkia* GetStepIllustration() const override;
base::string16 GetStepTitle() const override;
base::string16 GetStepDescription() const override;
};
#endif // CHROME_BROWSER_UI_WEBAUTHN_SHEET_MODELS_H_ #endif // CHROME_BROWSER_UI_WEBAUTHN_SHEET_MODELS_H_
...@@ -45,6 +45,9 @@ void AuthenticatorRequestDialogModel::StartGuidedFlowForTransport( ...@@ -45,6 +45,9 @@ void AuthenticatorRequestDialogModel::StartGuidedFlowForTransport(
case AuthenticatorTransport::kInternal: case AuthenticatorTransport::kInternal:
SetCurrentStep(Step::kTouchId); SetCurrentStep(Step::kTouchId);
break; break;
case AuthenticatorTransport::kCloudAssistedBluetoothLowEnergy:
SetCurrentStep(Step::kCableActivate);
break;
default: default:
break; break;
} }
......
...@@ -46,6 +46,9 @@ class AuthenticatorRequestDialogModel { ...@@ -46,6 +46,9 @@ class AuthenticatorRequestDialogModel {
// Touch ID. // Touch ID.
kTouchId, kTouchId,
// Phone as a security key.
kCableActivate,
}; };
// Encapsulates information about authenticators that have been found but are // Encapsulates information about authenticators that have been found but are
......
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