From 13ded7887ab0d35a1c9a6425d73ea47137224387 Mon Sep 17 00:00:00 2001 From: Josh Nohle Date: Wed, 17 Oct 2018 15:53:19 +0000 Subject: [PATCH] [CrOS MultiDevice] Change "Cancel" to "No thanks" in OOBE On the start setup page of OOBE, change the text of the cancel button to read "No thanks" instead of "Cancel". Screenshots: OOBE: https://drive.google.com/open?id=1QjHg1_v1QFg1tph986Xi2igPUYG8nJlneA post-OOBE: https://drive.google.com/open?id=1-hxQjU-WVMi8sAWNAZB-7LyrcX3F5ju5bQ Bug: 893353 Change-Id: I748f282b392bccfe17bd14f8bc036cca786bb8f9 Tested: Manual; ./out/Default/browser_tests --gtest_filter=*MultiDevice* Reviewed-on: https://chromium-review.googlesource.com/c/1272067 Commit-Queue: Josh Nohle Reviewed-by: Alexander Alekseev Reviewed-by: Kyle Horimoto Cr-Original-Commit-Position: refs/heads/master@{#599860}(cherry picked from commit 8c257639f2961de4ea8c5673514191e7b95ab377) Reviewed-on: https://chromium-review.googlesource.com/c/1286873 Reviewed-by: Jeremy Klein Cr-Commit-Position: refs/branch-heads/3578@{#84} Cr-Branched-From: 4226ddf99103e493d7afb23a4c7902ee496108b6-refs/heads/master@{#599034} --- .../login/multidevice_setup_first_run.js | 5 +++++ .../multidevice_setup/post_oobe_delegate.js | 5 +++++ ...tidevice_setup_localized_strings_provider.cc | 1 + .../webui/multidevice_setup/integration_test.js | 5 +++++ .../multidevice_setup/multidevice_setup.html | 3 ++- .../multidevice_setup_delegate.js | 3 +++ .../multidevice_setup/start_setup_page.js | 17 ++++++++++++++++- 7 files changed, 37 insertions(+), 2 deletions(-) diff --git a/chrome/browser/resources/chromeos/login/multidevice_setup_first_run.js b/chrome/browser/resources/chromeos/login/multidevice_setup_first_run.js index 796e5f049003..a9fe8d723c00 100644 --- a/chrome/browser/resources/chromeos/login/multidevice_setup_first_run.js +++ b/chrome/browser/resources/chromeos/login/multidevice_setup_first_run.js @@ -45,6 +45,11 @@ cr.define('multidevice_setup', function() { shouldExitSetupFlowAfterSettingHost() { return true; } + + /** @override */ + getStartSetupCancelButtonTextId() { + return 'noThanks'; + } } const MultiDeviceSetupFirstRun = Polymer({ diff --git a/chrome/browser/resources/chromeos/multidevice_setup/post_oobe_delegate.js b/chrome/browser/resources/chromeos/multidevice_setup/post_oobe_delegate.js index 2bb55720d183..a498e022b584 100644 --- a/chrome/browser/resources/chromeos/multidevice_setup/post_oobe_delegate.js +++ b/chrome/browser/resources/chromeos/multidevice_setup/post_oobe_delegate.js @@ -29,6 +29,11 @@ cr.define('multidevice_setup', function() { shouldExitSetupFlowAfterSettingHost() { return false; } + + /** @override */ + getStartSetupCancelButtonTextId() { + return 'cancel'; + } } return { diff --git a/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_localized_strings_provider.cc b/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_localized_strings_provider.cc index e80a1cf8b18b..fa8406459711 100644 --- a/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_localized_strings_provider.cc +++ b/chrome/browser/ui/webui/chromeos/multidevice_setup/multidevice_setup_localized_strings_provider.cc @@ -40,6 +40,7 @@ constexpr struct { {"back", IDS_MULTIDEVICE_SETUP_BACK_LABEL}, {"cancel", IDS_CANCEL}, {"done", IDS_DONE}, + {"noThanks", IDS_NO_THANKS}, {"passwordPageHeader", IDS_MULTIDEVICE_SETUP_PASSWORD_PAGE_HEADER}, {"enterPassword", IDS_MULTIDEVICE_SETUP_PASSWORD_PAGE_ENTER_PASSWORD_LABEL}, {"wrongPassword", IDS_MULTIDEVICE_SETUP_PASSWORD_PAGE_WRONG_PASSWORD_LABEL}, diff --git a/chrome/test/data/webui/multidevice_setup/integration_test.js b/chrome/test/data/webui/multidevice_setup/integration_test.js index 388e2622b99d..8a10e922ea1a 100644 --- a/chrome/test/data/webui/multidevice_setup/integration_test.js +++ b/chrome/test/data/webui/multidevice_setup/integration_test.js @@ -46,6 +46,11 @@ cr.define('multidevice_setup', () => { shouldExitSetupFlowAfterSettingHost() { return this.shouldExitSetupFlowAfterSettingHost_; } + + /** @override */ + getStartSetupCancelButtonTextId() { + return 'cancel'; + } } /** @implements {multidevice_setup.MojoInterfaceProvider} */ diff --git a/ui/webui/resources/cr_components/chromeos/multidevice_setup/multidevice_setup.html b/ui/webui/resources/cr_components/chromeos/multidevice_setup/multidevice_setup.html index fc8574553a4d..a75218ee4193 100644 --- a/ui/webui/resources/cr_components/chromeos/multidevice_setup/multidevice_setup.html +++ b/ui/webui/resources/cr_components/chromeos/multidevice_setup/multidevice_setup.html @@ -49,7 +49,8 @@ + selected-device-id="{{selectedDeviceId_}}" + delegate="[[delegate]]">
diff --git a/ui/webui/resources/cr_components/chromeos/multidevice_setup/multidevice_setup_delegate.js b/ui/webui/resources/cr_components/chromeos/multidevice_setup/multidevice_setup_delegate.js index ee281f956532..8526f38216bc 100644 --- a/ui/webui/resources/cr_components/chromeos/multidevice_setup/multidevice_setup_delegate.js +++ b/ui/webui/resources/cr_components/chromeos/multidevice_setup/multidevice_setup_delegate.js @@ -22,6 +22,9 @@ cr.define('multidevice_setup', function() { /** @return {boolean} */ shouldExitSetupFlowAfterSettingHost() {} + + /** @return {string} */ + getStartSetupCancelButtonTextId() {} } return { diff --git a/ui/webui/resources/cr_components/chromeos/multidevice_setup/start_setup_page.js b/ui/webui/resources/cr_components/chromeos/multidevice_setup/start_setup_page.js index 80cb12eac333..d9f6db488e75 100644 --- a/ui/webui/resources/cr_components/chromeos/multidevice_setup/start_setup_page.js +++ b/ui/webui/resources/cr_components/chromeos/multidevice_setup/start_setup_page.js @@ -15,7 +15,7 @@ Polymer({ /** Overridden from UiPageContainerBehavior. */ cancelButtonTextId: { type: String, - value: 'cancel', + computed: 'getCancelButtonTextId_(delegate)', }, /** Overridden from UiPageContainerBehavior. */ @@ -53,6 +53,12 @@ Polymer({ type: String, notify: true, }, + + /** + * Delegate object which performs differently in OOBE vs. non-OOBE mode. + * @type {!multidevice_setup.MultiDeviceSetupDelegate} + */ + delegate: Object, }, behaviors: [ @@ -83,6 +89,15 @@ Polymer({ } }, + /** + * @param {!multidevice_setup.MultiDeviceSetupDelegate} delegate + * @return {string} The cancel button text ID, dependent on OOBE vs. non-OOBE. + * @private + */ + getCancelButtonTextId_: function(delegate) { + return this.delegate.getStartSetupCancelButtonTextId(); + }, + /** * @param {!Array} devices * @return {string} Label for devices selection content.