Commit 0a7e64de authored by Regan Hsu's avatar Regan Hsu Committed by Chromium LUCI CQ

[CrOS PhoneHub] Update notification access setup flow UI.

When the user must go to their phone to complete setup, indicate it on
the notification access setup flow dialog UI.

Previously, at the success screen, the text says that the phone needs
to be unlocked, but this isn't true. That wording is eliminated.

Screenshots:
Connecting to your phone -
  https://screenshot.googleplex.com/4kpg3ZohRjfmkBQ
Complete setup on phone -
  https://screenshot.googleplex.com/z6LfDe4MFmGfuA8
Success -
  https://screenshot.googleplex.com/9X3fJZ2VbtQCkAL

Bug: 1142971, 1106937
Change-Id: Ic053108d9c564e55d72958e2686d411567f7ea70
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2577542
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Reviewed-by: default avatarKyle Horimoto <khorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834407}
parent 1c55a4b8
......@@ -2445,6 +2445,12 @@
<message name="IDS_SETTINGS_MULTIDEVICE_NOTIFICATION_ACCESS_SETUP_DIALOG_ACK_SUMMARY" desc="The summary of the dialog containing the Phone Hub notification opt-in flow shown when the Phone Hub 'Notifications' toggle is switched on.">
Receive notifications from your phone on your <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph>
</message>
<message name="IDS_SETTINGS_MULTIDEVICE_NOTIFICATION_ACCESS_SETUP_DIALOG_AWAITING_RESPONSE_TITLE" translateable="false" desc="The title of the dialog containing the Phone Hub notification opt-in flow shown when the user needs to follow the setup flow instructions on their phone in order to start mirroring notifications from their phone to their Chromebook.">
Complete setup on your phone
</message>
<message name="IDS_SETTINGS_MULTIDEVICE_NOTIFICATION_ACCESS_SETUP_DIALOG_AWAITING_RESPONSE_SUMMARY" translateable="false" desc="The body text of the dialog containing the Phone Hub notification opt-in flow shown when the user needs to follow the setup flow instructions on their phone in order to start mirroring notifications from their phone to their Chromebook.">
Make sure your phone is nearby, unlocked, and has Bluetooth and Wi-Fi turned on. Follow steps on your phone to complete setup.
</message>
<message name="IDS_SETTINGS_MULTIDEVICE_NOTIFICATION_ACCESS_SETUP_DIALOG_CONNECTING_TITLE" desc="The title of the dialog containing the Phone Hub notification opt-in flow shown when the user has confirmed to enable the feature that will mirror phone notifications to their Chromebook.">
Connecting to your phone
</message>
......@@ -2454,8 +2460,8 @@
<message name="IDS_SETTINGS_MULTIDEVICE_NOTIFICATION_ACCESS_SETUP_DIALOG_COMPLETED_TITLE" desc="The title of the dialog containing the Phone Hub notification opt-in flow when the feature is successfully turned on and notifications on their phone will now be mirrored to their Chromebook.">
Notifications turned on
</message>
<message name="IDS_SETTINGS_MULTIDEVICE_NOTIFICATION_ACCESS_SETUP_DIALOG_COMPLETED_SUMMARY" desc="The body text of the dialog containing the Phone Hub notification opt-in flow when the feature is successfully turned on and notifications on their phone will now be mirrored to their Chromebook.">
You can now receive notifications from your phone on your <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph>. Dismissing notifications on your <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> will also dismiss them on your phone. Make sure your phone is nearby, unlocked, and has Bluetooth and Wi-Fi turned on.
<message name="IDS_SETTINGS_MULTIDEVICE_NOTIFICATION_ACCESS_SETUP_DIALOG_COMPLETED_SUMMARY" translateable="false" desc="The body text of the dialog containing the Phone Hub notification opt-in flow when the feature is successfully turned on and notifications on their phone will now be mirrored to their Chromebook.">
You can now receive notifications from your phone on your <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph>. Dismissing notifications on your <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> will also dismiss them on your phone. Make sure your phone is nearby and has Bluetooth and Wi-Fi turned on.
</message>
<message name="IDS_SETTINGS_MULTIDEVICE_NOTIFICATION_ACCESS_SETUP_DIALOG_COULD_NOT_ESTABLISH_CONNECTION_TITLE" desc="The title of the dialog containing the Phone Hub notification opt-in flow when the device is unable to establish a connection to the phone.">
Could not establish connection
......
......@@ -93,7 +93,7 @@ Polymer({
shouldShowSetupInstructionsSeparately_: {
type: Boolean,
computed: 'computeShouldShowSetupInstructionsSeparately_(' +
'hasNotStartedSetupAttempt_, isSetupAttemptInProgress_)',
'setupState_)',
reflectToAttribute: true,
},
},
......@@ -180,7 +180,10 @@ Polymer({
* @private
*/
computeShouldShowSetupInstructionsSeparately_() {
return this.isSetupAttemptInProgress_ || this.hasNotStartedSetupAttempt_;
return this.setupState_ === null ||
this.setupState_ ===
NotificationAccessSetupOperationStatus.CONNECTION_REQUESTED ||
this.setupState_ === NotificationAccessSetupOperationStatus.CONNECTING;
},
/** @private */
......@@ -214,8 +217,10 @@ Polymer({
switch (this.setupState_) {
case Status.CONNECTION_REQUESTED:
case Status.CONNECTING:
case Status.SENT_MESSAGE_TO_PHONE_AND_WAITING_FOR_RESPONSE:
return this.i18n('multideviceNotificationAccessSetupConnectingTitle');
case Status.SENT_MESSAGE_TO_PHONE_AND_WAITING_FOR_RESPONSE:
return this.i18n(
'multideviceNotificationAccessSetupAwaitingResponseTitle');
case Status.COMPLETED_SUCCESSFULLY:
return this.i18n('multideviceNotificationAccessSetupCompletedTitle');
case Status.TIMED_OUT_CONNECTING:
......@@ -254,11 +259,13 @@ Polymer({
case Status.NOTIFICATION_ACCESS_PROHIBITED:
return this.i18nAdvanced(
'multideviceNotificationAccessSetupAccessProhibitedSummary');
case Status.SENT_MESSAGE_TO_PHONE_AND_WAITING_FOR_RESPONSE:
return this.i18n(
'multideviceNotificationAccessSetupAwaitingResponseSummary');
// Only setup instructions will be shown.
case Status.CONNECTION_REQUESTED:
case Status.CONNECTING:
case Status.SENT_MESSAGE_TO_PHONE_AND_WAITING_FOR_RESPONSE:
default:
return '';
}
......
......@@ -285,6 +285,10 @@ void MultiDeviceSection::AddLoadTimeData(
IDS_SETTINGS_MULTIDEVICE_NOTIFICATION_ACCESS_SETUP_DIALOG_ACK_TITLE},
{"multideviceNotificationAccessSetupConnectingTitle",
IDS_SETTINGS_MULTIDEVICE_NOTIFICATION_ACCESS_SETUP_DIALOG_CONNECTING_TITLE},
{"multideviceNotificationAccessSetupAwaitingResponseTitle",
IDS_SETTINGS_MULTIDEVICE_NOTIFICATION_ACCESS_SETUP_DIALOG_AWAITING_RESPONSE_TITLE},
{"multideviceNotificationAccessSetupAwaitingResponseSummary",
IDS_SETTINGS_MULTIDEVICE_NOTIFICATION_ACCESS_SETUP_DIALOG_AWAITING_RESPONSE_SUMMARY},
{"multideviceNotificationAccessSetupInstructions",
IDS_SETTINGS_MULTIDEVICE_NOTIFICATION_ACCESS_SETUP_DIALOG_INSTRUCTIONS},
{"multideviceNotificationAccessSetupCompletedTitle",
......
......@@ -31,6 +31,11 @@ suite('Multidevice', () => {
Polymer.dom.flush();
}
/** @return {boolean} */
function isSetupInstructionsShownSeparately() {
return notificationAccessSetupDialog.shouldShowSetupInstructionsSeparately_;
}
setup(() => {
PolymerTest.clearBody();
browserProxy = new multidevice.TestMultideviceBrowserProxy();
......@@ -46,6 +51,7 @@ suite('Multidevice', () => {
});
test('Test success flow', async () => {
assertTrue(isSetupInstructionsShownSeparately());
assertTrue(!!buttonContainer.querySelector('#cancelButton'));
assertTrue(!!buttonContainer.querySelector('#getStartedButton'));
assertFalse(!!buttonContainer.querySelector('#doneButton'));
......@@ -55,12 +61,14 @@ suite('Multidevice', () => {
simulateStatusChanged(
NotificationAccessSetupOperationStatus.CONNECTION_REQUESTED);
assertTrue(isSetupInstructionsShownSeparately());
assertTrue(!!buttonContainer.querySelector('#cancelButton'));
assertFalse(!!buttonContainer.querySelector('#getStartedButton'));
assertFalse(!!buttonContainer.querySelector('#doneButton'));
assertFalse(!!buttonContainer.querySelector('#tryAgainButton'));
simulateStatusChanged(NotificationAccessSetupOperationStatus.CONNECTING);
assertTrue(isSetupInstructionsShownSeparately());
assertTrue(!!buttonContainer.querySelector('#cancelButton'));
assertFalse(!!buttonContainer.querySelector('#getStartedButton'));
assertFalse(!!buttonContainer.querySelector('#doneButton'));
......@@ -68,6 +76,7 @@ suite('Multidevice', () => {
simulateStatusChanged(NotificationAccessSetupOperationStatus.
SENT_MESSAGE_TO_PHONE_AND_WAITING_FOR_RESPONSE);
assertFalse(isSetupInstructionsShownSeparately());
assertTrue(!!buttonContainer.querySelector('#cancelButton'));
assertFalse(!!buttonContainer.querySelector('#getStartedButton'));
assertFalse(!!buttonContainer.querySelector('#doneButton'));
......@@ -75,7 +84,7 @@ suite('Multidevice', () => {
simulateStatusChanged(
NotificationAccessSetupOperationStatus.COMPLETED_SUCCESSFULLY);
assertFalse(isSetupInstructionsShownSeparately());
assertFalse(!!buttonContainer.querySelector('#cancelButton'));
assertFalse(!!buttonContainer.querySelector('#getStartedButton'));
assertTrue(!!buttonContainer.querySelector('#doneButton'));
......
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