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

Add BLE pairing begin dialog

Add dialog before BLE device selection view instructing the user to
begin pairing process.

Bug: 877344
Change-Id: I9f8bf8b011231a20a09ebbb2ab8073792df276ef
Reviewed-on: https://chromium-review.googlesource.com/c/1356122
Commit-Queue: Jun Choi <hongjunchoi@chromium.org>
Reviewed-by: default avatarKim Paulhamus <kpaulhamus@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612560}
parent 5fc98383
......@@ -438,6 +438,11 @@ base::string16 AuthenticatorBlePairingBeginSheetModel::GetAcceptButtonLabel()
return l10n_util::GetStringUTF16(IDS_WEBAUTHN_BLE_PAIRING_BEGIN_NEXT);
}
void AuthenticatorBlePairingBeginSheetModel::OnAccept() {
dialog_model()->SetCurrentStep(
AuthenticatorRequestDialogModel::Step::kBleDeviceSelection);
}
// AuthenticatorBleEnterPairingModeSheetModel ---------------------------------
gfx::ImageSkia*
......
......@@ -233,6 +233,7 @@ class AuthenticatorBlePairingBeginSheetModel
bool IsAcceptButtonVisible() const override;
bool IsAcceptButtonEnabled() const override;
base::string16 GetAcceptButtonLabel() const override;
void OnAccept() override;
};
class AuthenticatorBleEnterPairingModeSheetModel
......
......@@ -153,7 +153,7 @@ void AuthenticatorRequestDialogModel::StartGuidedFlowForTransport(
Step next_step = ShouldShowBlePairingUI(
previously_paired_with_bluetooth_authenticator_,
pair_with_new_device_for_bluetooth_low_energy)
? Step::kBleDeviceSelection
? Step::kBlePairingBegin
: Step::kBleActivate;
EnsureBleAdapterIsPoweredBeforeContinuingWithStep(next_step);
break;
......
......@@ -371,7 +371,7 @@ TEST_F(AuthenticatorRequestDialogModelTest, BlePairingFlow) {
Step expected_final_step;
} kTestCases[] = {
{AuthenticatorTransport::kBluetoothLowEnergy, nullptr,
Step::kBleDeviceSelection},
Step::kBlePairingBegin},
{AuthenticatorTransport::kBluetoothLowEnergy, &test_paired_device_list_,
Step::kBleActivate},
};
......
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