Commit 04e61e50 authored by Renato Silva's avatar Renato Silva Committed by Commit Bot

Chrome OS OOBE - Marketing Opt-In Screen Styles

- Enable marketing opt-in screen for clamshell mode. Previously
  disabled.
- Change command line switch to feature.
- Enable the marketing screen by default
- Update the styles on the marketing opt-in screen.
- Prepare the screen to be attached to the new ChromebookEmail
  component that will be added.
- Fix broken tests.

Fixed: 1023370
Change-Id: Iaa4f7b595452afafd5d501ca28991b06ea204b1e
Bug: 1023370
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2127926
Commit-Queue: Renato Silva <rrsilva@google.com>
Reviewed-by: default avatarDenis Kuznetsov [CET] <antrim@chromium.org>
Reviewed-by: default avatarRoman Sorokin [CET] <rsorokin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#755883}
parent 5938f3fa
...@@ -878,9 +878,6 @@ ...@@ -878,9 +878,6 @@
<message name="IDS_LOGIN_MARKETING_OPT_IN_SCREEN_SUBTITLE_WITH_DEVICE_NAME" desc="The sub-title of the marketing opt in screen which will also include the name of the user's device."> <message name="IDS_LOGIN_MARKETING_OPT_IN_SCREEN_SUBTITLE_WITH_DEVICE_NAME" desc="The sub-title of the marketing opt in screen which will also include the name of the user's device.">
You are ready to start using your <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph>. You are ready to start using your <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph>.
</message> </message>
<message name="IDS_LOGIN_MARKETING_OPT_IN_SCREEN_GET_PLAY_UPDATES" desc="A label next to the checkbox that controls user subscription to marketing updates from Google about Google Play Store.">
Get the latest updates and recommendations on Play Store apps
</message>
<message name="IDS_LOGIN_MARKETING_OPT_IN_SCREEN_GET_CHROMEBOOK_UPDATES" desc="A lablel next to the checkbox that controls user subscription to marketing updates and useful information about the user's Chrome device."> <message name="IDS_LOGIN_MARKETING_OPT_IN_SCREEN_GET_CHROMEBOOK_UPDATES" desc="A lablel next to the checkbox that controls user subscription to marketing updates and useful information about the user's Chrome device.">
Tips and updates on <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph> Tips and updates on <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph>
</message> </message>
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "chrome/browser/chromeos/login/test/active_directory_login_mixin.h" #include "chrome/browser/chromeos/login/test/active_directory_login_mixin.h"
#include "chrome/browser/chromeos/login/test/device_state_mixin.h" #include "chrome/browser/chromeos/login/test/device_state_mixin.h"
#include "chrome/browser/chromeos/login/test/oobe_base_test.h" #include "chrome/browser/chromeos/login/test/oobe_base_test.h"
#include "chrome/browser/chromeos/login/test/oobe_screens_utils.h"
#include "chrome/browser/chromeos/login/test/session_manager_state_waiter.h" #include "chrome/browser/chromeos/login/test/session_manager_state_waiter.h"
#include "chrome/browser/chromeos/login/wizard_controller.h" #include "chrome/browser/chromeos/login/wizard_controller.h"
#include "chromeos/dbus/authpolicy/fake_authpolicy_client.h" #include "chromeos/dbus/authpolicy/fake_authpolicy_client.h"
...@@ -112,6 +113,7 @@ IN_PROC_BROWSER_TEST_F(ActiveDirectoryLoginTest, MAYBE_LoginSuccess) { ...@@ -112,6 +113,7 @@ IN_PROC_BROWSER_TEST_F(ActiveDirectoryLoginTest, MAYBE_LoginSuccess) {
ad_login_.TestNoError(); ad_login_.TestNoError();
ad_login_.TestDomainHidden(); ad_login_.TestDomainHidden();
ad_login_.SubmitActiveDirectoryCredentials(test_user_, kPassword); ad_login_.SubmitActiveDirectoryCredentials(test_user_, kPassword);
test::WaitForLastScreenAndTapGetStarted();
test::WaitForPrimaryUserSessionStart(); test::WaitForPrimaryUserSessionStart();
} }
...@@ -128,6 +130,7 @@ IN_PROC_BROWSER_TEST_F(ActiveDirectoryLoginTest, MAYBE_KerberosVarsCopied) { ...@@ -128,6 +130,7 @@ IN_PROC_BROWSER_TEST_F(ActiveDirectoryLoginTest, MAYBE_KerberosVarsCopied) {
ad_login_.TestNoError(); ad_login_.TestNoError();
ad_login_.TestDomainHidden(); ad_login_.TestDomainHidden();
ad_login_.SubmitActiveDirectoryCredentials(test_user_, kPassword); ad_login_.SubmitActiveDirectoryCredentials(test_user_, kPassword);
test::WaitForLastScreenAndTapGetStarted();
test::WaitForPrimaryUserSessionStart(); test::WaitForPrimaryUserSessionStart();
base::FilePath dir; base::FilePath dir;
...@@ -194,6 +197,7 @@ IN_PROC_BROWSER_TEST_F(ActiveDirectoryLoginTest, PasswordChange_LoginSuccess) { ...@@ -194,6 +197,7 @@ IN_PROC_BROWSER_TEST_F(ActiveDirectoryLoginTest, PasswordChange_LoginSuccess) {
fake_authpolicy_client()->set_auth_error(authpolicy::ERROR_NONE); fake_authpolicy_client()->set_auth_error(authpolicy::ERROR_NONE);
ad_login_.SubmitActiveDirectoryPasswordChangeCredentials( ad_login_.SubmitActiveDirectoryPasswordChangeCredentials(
kPassword, kNewPassword, kNewPassword); kPassword, kNewPassword, kNewPassword);
test::WaitForLastScreenAndTapGetStarted();
test::WaitForPrimaryUserSessionStart(); test::WaitForPrimaryUserSessionStart();
} }
...@@ -267,6 +271,7 @@ IN_PROC_BROWSER_TEST_F(ActiveDirectoryLoginAutocompleteTest, ...@@ -267,6 +271,7 @@ IN_PROC_BROWSER_TEST_F(ActiveDirectoryLoginAutocompleteTest,
ad_login_.SubmitActiveDirectoryCredentials(kTestActiveDirectoryUser, ad_login_.SubmitActiveDirectoryCredentials(kTestActiveDirectoryUser,
kPassword); kPassword);
test::WaitForLastScreenAndTapGetStarted();
test::WaitForPrimaryUserSessionStart(); test::WaitForPrimaryUserSessionStart();
} }
......
...@@ -742,8 +742,9 @@ void OobeInteractiveUITest::PerformSessionSignInSteps( ...@@ -742,8 +742,9 @@ void OobeInteractiveUITest::PerformSessionSignInSteps(
if (test_setup()->is_tablet() && if (test_setup()->is_tablet() &&
test_setup()->hide_shelf_controls_in_tablet_mode()) { test_setup()->hide_shelf_controls_in_tablet_mode()) {
HandleGestureNavigationScreen(); HandleGestureNavigationScreen();
HandleMarketingOptInScreen();
} }
HandleMarketingOptInScreen();
} }
void OobeInteractiveUITest::SimpleEndToEnd() { void OobeInteractiveUITest::SimpleEndToEnd() {
......
...@@ -11,11 +11,13 @@ ...@@ -11,11 +11,13 @@
#include "base/bind.h" #include "base/bind.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/logging.h" #include "base/logging.h"
#include "chrome/browser/chromeos/login/screen_manager.h"
#include "chrome/browser/chromeos/login/screens/gesture_navigation_screen.h" #include "chrome/browser/chromeos/login/screens/gesture_navigation_screen.h"
#include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h" #include "chrome/browser/chromeos/login/users/chrome_user_manager_util.h"
#include "chrome/browser/profiles/profile.h" #include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h" #include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h"
#include "chrome/common/chrome_features.h"
#include "chrome/common/pref_names.h" #include "chrome/common/pref_names.h"
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "chromeos/constants/chromeos_switches.h" #include "chromeos/constants/chromeos_switches.h"
...@@ -42,35 +44,17 @@ MarketingOptInScreen::~MarketingOptInScreen() { ...@@ -42,35 +44,17 @@ MarketingOptInScreen::~MarketingOptInScreen() {
void MarketingOptInScreen::ShowImpl() { void MarketingOptInScreen::ShowImpl() {
PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs(); PrefService* prefs = ProfileManager::GetActiveUserProfile()->GetPrefs();
const bool did_skip_gesture_navigation_screen =
!prefs->GetBoolean(ash::prefs::kGestureEducationNotificationShown);
// Always skip the screen if it is a public session or non-regular ephemeral
// user login. Also skip the screen if clamshell mode is active.
// TODO(mmourgos): Enable this screen for clamshell mode.
if (chrome_user_manager_util::IsPublicSessionOrEphemeralLogin() ||
did_skip_gesture_navigation_screen) {
exit_callback_.Run();
return;
}
// Skip the screen if: // Skip the screen if:
// 1) the feature is disabled, or // 1) the feature is disabled, or
// 2) the screen has been shown for this user // 2) it is a public session or non-regular ephemeral user login
// AND if (!base::FeatureList::IsEnabled(features::kOobeMarketingScreen) ||
// 3) the hide shelf controls in tablet mode feature is disabled. chrome_user_manager_util::IsPublicSessionOrEphemeralLogin()) {
if ((!base::CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kEnableMarketingOptInScreen) ||
prefs->GetBoolean(prefs::kOobeMarketingOptInScreenFinished)) &&
!ash::features::IsHideShelfControlsInTabletModeEnabled()) {
exit_callback_.Run(); exit_callback_.Run();
return; return;
} }
active_ = true; active_ = true;
view_->Show(); view_->Show();
prefs->SetBoolean(prefs::kOobeMarketingOptInScreenFinished, true);
view_->UpdateA11yShelfNavigationButtonToggle(prefs->GetBoolean( view_->UpdateA11yShelfNavigationButtonToggle(prefs->GetBoolean(
ash::prefs::kAccessibilityTabletModeShelfNavigationButtonsEnabled)); ash::prefs::kAccessibilityTabletModeShelfNavigationButtonsEnabled));
...@@ -95,9 +79,9 @@ void MarketingOptInScreen::HideImpl() { ...@@ -95,9 +79,9 @@ void MarketingOptInScreen::HideImpl() {
view_->Hide(); view_->Hide();
} }
void MarketingOptInScreen::OnAllSet(bool play_communications_opt_in, void MarketingOptInScreen::OnGetStarted(bool chromebook_email_opt_in) {
bool tips_communications_opt_in) { // Call Chromebook Email Service API
// TODO(https://crbug.com/852557) // TODO(https://crbug.com/1056672)
ExitScreen(); ExitScreen();
} }
......
...@@ -23,9 +23,8 @@ class MarketingOptInScreen : public BaseScreen { ...@@ -23,9 +23,8 @@ class MarketingOptInScreen : public BaseScreen {
const base::RepeatingClosure& exit_callback); const base::RepeatingClosure& exit_callback);
~MarketingOptInScreen() override; ~MarketingOptInScreen() override;
// On "All set" button pressed. // On "Get Started" button pressed.
void OnAllSet(bool play_communications_opt_in, void OnGetStarted(bool chromebook_email_opt_in);
bool tips_communications_opt_in);
void set_exit_callback_for_testing( void set_exit_callback_for_testing(
const base::RepeatingClosure& exit_callback) { const base::RepeatingClosure& exit_callback) {
......
...@@ -88,31 +88,11 @@ class MarketingOptInScreenTest : public OobeBaseTest { ...@@ -88,31 +88,11 @@ class MarketingOptInScreenTest : public OobeBaseTest {
// Tests that marketing opt in toggles are hidden by default (as the command // Tests that marketing opt in toggles are hidden by default (as the command
// line switch to show marketing opt in is not set). // line switch to show marketing opt in is not set).
IN_PROC_BROWSER_TEST_F(MarketingOptInScreenTest, MarketingTogglesHidden) { IN_PROC_BROWSER_TEST_F(MarketingOptInScreenTest, MarketingToggleVisible) {
ShowMarketingOptInScreen(); ShowMarketingOptInScreen();
OobeScreenWaiter(MarketingOptInScreenView::kScreenId).Wait(); OobeScreenWaiter(MarketingOptInScreenView::kScreenId).Wait();
test::OobeJS().ExpectHiddenPath( test::OobeJS().ExpectVisiblePath(
{"marketing-opt-in", "marketing-opt-in-subtitle"});
test::OobeJS().ExpectHiddenPath(
{"marketing-opt-in", "marketing-opt-in-toggle-1"});
test::OobeJS().ExpectHiddenPath(
{"marketing-opt-in", "marketing-opt-in-toggle-2"});
ash::ShellTestApi().SetTabletModeEnabledForTest(false);
test::OobeJS().ExpectHiddenPath(
{"marketing-opt-in", "marketing-opt-in-subtitle"});
test::OobeJS().ExpectHiddenPath(
{"marketing-opt-in", "marketing-opt-in-toggle-1"});
test::OobeJS().ExpectHiddenPath(
{"marketing-opt-in", "marketing-opt-in-toggle-2"});
ash::ShellTestApi().SetTabletModeEnabledForTest(true);
test::OobeJS().ExpectHiddenPath(
{"marketing-opt-in", "marketing-opt-in-subtitle"}); {"marketing-opt-in", "marketing-opt-in-subtitle"});
test::OobeJS().ExpectHiddenPath(
{"marketing-opt-in", "marketing-opt-in-toggle-1"});
test::OobeJS().ExpectHiddenPath(
{"marketing-opt-in", "marketing-opt-in-toggle-2"});
} }
// Tests that the user can enable shelf navigation buttons in tablet mode from // Tests that the user can enable shelf navigation buttons in tablet mode from
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
#include "chrome/browser/chromeos/login/test/fake_gaia_mixin.h" #include "chrome/browser/chromeos/login/test/fake_gaia_mixin.h"
#include "chrome/browser/chromeos/login/test/js_checker.h" #include "chrome/browser/chromeos/login/test/js_checker.h"
#include "chrome/browser/chromeos/login/test/oobe_base_test.h" #include "chrome/browser/chromeos/login/test/oobe_base_test.h"
#include "chrome/browser/chromeos/login/test/oobe_screens_utils.h"
#include "chrome/browser/chromeos/login/test/session_manager_state_waiter.h" #include "chrome/browser/chromeos/login/test/session_manager_state_waiter.h"
#include "chrome/browser/chromeos/login/test/test_condition_waiter.h" #include "chrome/browser/chromeos/login/test/test_condition_waiter.h"
#include "chrome/browser/chromeos/login/ui/login_display_host.h" #include "chrome/browser/chromeos/login/ui/login_display_host.h"
...@@ -282,6 +283,7 @@ IN_PROC_BROWSER_TEST_P(SyncConsentPolicyDisabledTest, ...@@ -282,6 +283,7 @@ IN_PROC_BROWSER_TEST_P(SyncConsentPolicyDisabledTest,
screen->OnStateChanged(nullptr); screen->OnStateChanged(nullptr);
// Expect for other screens to be skipped and begin user session. // Expect for other screens to be skipped and begin user session.
test::WaitForLastScreenAndTapGetStarted();
test::WaitForPrimaryUserSessionStart(); test::WaitForPrimaryUserSessionStart();
} }
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#include "chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/enrollment_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/eula_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/eula_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/fingerprint_setup_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/fingerprint_setup_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/marketing_opt_in_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/network_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/update_screen_handler.h"
#include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h" #include "chrome/browser/ui/webui/chromeos/login/welcome_screen_handler.h"
...@@ -141,6 +142,12 @@ void WaitForEnrollmentScreen() { ...@@ -141,6 +142,12 @@ void WaitForEnrollmentScreen() {
WaitFor(EnrollmentScreenView::kScreenId); WaitFor(EnrollmentScreenView::kScreenId);
} }
void WaitForLastScreenAndTapGetStarted() {
WaitFor(MarketingOptInScreenView::kScreenId);
test::OobeJS().TapOnPath(
{"marketing-opt-in", "marketing-opt-in-next-button"});
}
void WaitForEulaScreen() { void WaitForEulaScreen() {
#if BUILDFLAG(GOOGLE_CHROME_BRANDING) #if BUILDFLAG(GOOGLE_CHROME_BRANDING)
WaitFor(EulaView::kScreenId); WaitFor(EulaView::kScreenId);
......
...@@ -26,6 +26,7 @@ void WaitForEulaScreen(); ...@@ -26,6 +26,7 @@ void WaitForEulaScreen();
void TapEulaAccept(); void TapEulaAccept();
void WaitForSyncConsentScreen(); void WaitForSyncConsentScreen();
void ExitScreenSyncConsent(); void ExitScreenSyncConsent();
void WaitForLastScreenAndTapGetStarted();
} // namespace test } // namespace test
} // namespace chromeos } // namespace chromeos
......
...@@ -24,14 +24,11 @@ ...@@ -24,14 +24,11 @@
} }
.marketing-option { .marketing-option {
border-bottom: var(--marketing-opt-in-dialog-list-item-border);
border-top: var(--marketing-opt-in-dialog-list-item-border); border-top: var(--marketing-opt-in-dialog-list-item-border);
color: var(--google-grey-900); color: var(--google-grey-900);
height: 48px;
line-height: 20px; line-height: 20px;
min-height: 48px;
}
.marketing-option:last-of-type {
border-bottom: var(--marketing-opt-in-dialog-list-item-border);
} }
.marketing-option hd-iron-icon { .marketing-option hd-iron-icon {
...@@ -48,4 +45,4 @@ ...@@ -48,4 +45,4 @@
#finalAccessibilityPage oobe-a11y-option:last-of-type { #finalAccessibilityPage oobe-a11y-option:last-of-type {
border-bottom: var(--oobe-a11y-dialog-list-item-border); border-bottom: var(--oobe-a11y-dialog-list-item-border);
} }
\ No newline at end of file
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
</hd-iron-icon> </hd-iron-icon>
<div slot="subtitle" id="marketing-opt-in-subtitle" <div slot="subtitle" id="marketing-opt-in-subtitle"
hidden="[[!marketingOptInEnabled_]]"> hidden="[[!marketingOptInEnabled_]]">
[[i18nRecursive(locale, 'marketingOptInScreenSubtitle', 'productName')]] [[i18nDynamic(locale, 'marketingOptInScreenSubtitle')]]
</div> </div>
<div slot="subtitle" id="marketing-opt-in-subtitle" <div slot="subtitle" id="marketing-opt-in-subtitle"
hidden="[[marketingOptInEnabled_]]"> hidden="[[marketingOptInEnabled_]]">
...@@ -49,24 +49,11 @@ ...@@ -49,24 +49,11 @@
<div slot="footer" class="layout vertical flex"> <div slot="footer" class="layout vertical flex">
<div class="marketing-option layout horizontal center" <div class="marketing-option layout horizontal center"
hidden="[[!marketingOptInEnabled_]]" hidden="[[!marketingOptInEnabled_]]"
id="marketing-opt-in-toggle-1"> id="marketing-opt-in-toggle">
<hd-iron-icon icon1x="oobe-32:checkmark" icon2x="oobe-64:checkmark"> <hd-iron-icon icon1x="oobe-32:chromebook" icon2x="oobe-64:chromebook">
</hd-iron-icon>
<div id="playUpdatesOptionLabel" class="flex">
[[i18nDynamic(locale, 'marketingOptInGetPlayUpdates')]]
</div>
<cr-toggle id="playUpdatesOption" checked
aria-labelledby="usageStatsLabel">
</cr-toggle>
</div>
<div class="marketing-option layout horizontal center"
hidden="[[!marketingOptInEnabled_]]"
id="marketing-opt-in-toggle-2">
<hd-iron-icon icon1x="oobe-32:checkmark" icon2x="oobe-64:checkmark">
</hd-iron-icon> </hd-iron-icon>
<div id="chromebookUpdatesOptionLabel" class="flex"> <div id="chromebookUpdatesOptionLabel" class="flex">
[[i18nRecursive(locale, 'marketingOptInGetChromebookUpdates', [[i18nDynamic(locale, 'marketingOptInGetChromebookUpdates')]]
'productName')]]
</div> </div>
<cr-toggle id="chromebookUpdatesOption" checked <cr-toggle id="chromebookUpdatesOption" checked
aria-labelledby="chromebookUpdatesOption"> aria-labelledby="chromebookUpdatesOption">
...@@ -85,7 +72,7 @@ ...@@ -85,7 +72,7 @@
icon2x="marketing-opt-in-64:accessibility" icon2x="marketing-opt-in-64:accessibility"
text-key="marketingOptInA11yButtonLabel"> text-key="marketingOptInA11yButtonLabel">
</oobe-welcome-secondary-button> </oobe-welcome-secondary-button>
<oobe-text-button on-tap="onAllSet_" class="focus-on-show" <oobe-text-button on-tap="onGetStarted_" class="focus-on-show"
inverse text-key="marketingOptInScreenAllSet" inverse text-key="marketingOptInScreenAllSet"
id="marketing-opt-in-next-button"> id="marketing-opt-in-next-button">
</oobe-text-button> </oobe-text-button>
...@@ -117,7 +104,7 @@ ...@@ -117,7 +104,7 @@
<div slot="bottom-buttons" class="layout horizontal justified"> <div slot="bottom-buttons" class="layout horizontal justified">
<oobe-back-button on-tap="onToggleAccessibilityPage_" <oobe-back-button on-tap="onToggleAccessibilityPage_"
id="final-accessibility-back-button"></oobe-back-button> id="final-accessibility-back-button"></oobe-back-button>
<oobe-text-button on-tap="onAllSet_" class="focus-on-show" <oobe-text-button on-tap="onGetStarted_" class="focus-on-show"
id="final-accessibility-next-button" inverse id="final-accessibility-next-button" inverse
text-key="finalA11yPageDoneButtonTitle"> text-key="finalA11yPageDoneButtonTitle">
</oobe-text-button> </oobe-text-button>
......
...@@ -25,9 +25,6 @@ Polymer({ ...@@ -25,9 +25,6 @@ Polymer({
marketingOptInEnabled_: { marketingOptInEnabled_: {
type: Boolean, type: Boolean,
readOnly: true, readOnly: true,
value() {
return loadTimeData.getBoolean('enableMarketingOptIn');
},
}, },
}, },
...@@ -60,13 +57,13 @@ Polymer({ ...@@ -60,13 +57,13 @@ Polymer({
* This is 'on-tap' event handler for 'AcceptAndContinue/Next' buttons. * This is 'on-tap' event handler for 'AcceptAndContinue/Next' buttons.
* @private * @private
*/ */
onAllSet_() { onGetStarted_() {
this.$['marketingOptInOverviewDialog'] this.$['marketingOptInOverviewDialog']
.querySelector('.marketing-animation') .querySelector('.marketing-animation')
.setPlay(false); .setPlay(false);
chrome.send('login.MarketingOptInScreen.allSet', [ chrome.send(
this.$.playUpdatesOption.checked, this.$.chromebookUpdatesOption.checked 'login.MarketingOptInScreen.onGetStarted',
]); [this.$.chromebookUpdatesOption.checked]);
}, },
/** /**
......
...@@ -43,15 +43,15 @@ void MarketingOptInScreenHandler::DeclareLocalizedValues( ...@@ -43,15 +43,15 @@ void MarketingOptInScreenHandler::DeclareLocalizedValues(
::login::LocalizedValuesBuilder* builder) { ::login::LocalizedValuesBuilder* builder) {
builder->Add("marketingOptInScreenTitle", builder->Add("marketingOptInScreenTitle",
IDS_LOGIN_MARKETING_OPT_IN_SCREEN_TITLE); IDS_LOGIN_MARKETING_OPT_IN_SCREEN_TITLE);
builder->Add("marketingOptInScreenSubtitle", builder->AddF("marketingOptInScreenSubtitle",
IDS_LOGIN_MARKETING_OPT_IN_SCREEN_SUBTITLE); IDS_LOGIN_MARKETING_OPT_IN_SCREEN_SUBTITLE,
ui::GetChromeOSDeviceName());
builder->AddF("marketingOptInScreenSubtitleWithDeviceName", builder->AddF("marketingOptInScreenSubtitleWithDeviceName",
IDS_LOGIN_MARKETING_OPT_IN_SCREEN_SUBTITLE_WITH_DEVICE_NAME, IDS_LOGIN_MARKETING_OPT_IN_SCREEN_SUBTITLE_WITH_DEVICE_NAME,
ui::GetChromeOSDeviceName()); ui::GetChromeOSDeviceName());
builder->Add("marketingOptInGetPlayUpdates", builder->AddF("marketingOptInGetChromebookUpdates",
IDS_LOGIN_MARKETING_OPT_IN_SCREEN_GET_PLAY_UPDATES); IDS_LOGIN_MARKETING_OPT_IN_SCREEN_GET_CHROMEBOOK_UPDATES,
builder->Add("marketingOptInGetChromebookUpdates", ui::GetChromeOSDeviceName());
IDS_LOGIN_MARKETING_OPT_IN_SCREEN_GET_CHROMEBOOK_UPDATES);
builder->Add("marketingOptInScreenAllSet", builder->Add("marketingOptInScreenAllSet",
IDS_LOGIN_MARKETING_OPT_IN_SCREEN_ALL_SET); IDS_LOGIN_MARKETING_OPT_IN_SCREEN_ALL_SET);
builder->Add("marketingOptInA11yButtonLabel", builder->Add("marketingOptInA11yButtonLabel",
...@@ -89,8 +89,8 @@ void MarketingOptInScreenHandler::UpdateA11yShelfNavigationButtonToggle( ...@@ -89,8 +89,8 @@ void MarketingOptInScreenHandler::UpdateA11yShelfNavigationButtonToggle(
void MarketingOptInScreenHandler::Initialize() {} void MarketingOptInScreenHandler::Initialize() {}
void MarketingOptInScreenHandler::RegisterMessages() { void MarketingOptInScreenHandler::RegisterMessages() {
AddCallback("login.MarketingOptInScreen.allSet", AddCallback("login.MarketingOptInScreen.onGetStarted",
&MarketingOptInScreenHandler::HandleAllSet); &MarketingOptInScreenHandler::HandleOnGetStarted);
AddCallback( AddCallback(
"login.MarketingOptInScreen.setA11yNavigationButtonsEnabled", "login.MarketingOptInScreen.setA11yNavigationButtonsEnabled",
&MarketingOptInScreenHandler::HandleSetA11yNavigationButtonsEnabled); &MarketingOptInScreenHandler::HandleSetA11yNavigationButtonsEnabled);
...@@ -98,16 +98,12 @@ void MarketingOptInScreenHandler::RegisterMessages() { ...@@ -98,16 +98,12 @@ void MarketingOptInScreenHandler::RegisterMessages() {
void MarketingOptInScreenHandler::GetAdditionalParameters( void MarketingOptInScreenHandler::GetAdditionalParameters(
base::DictionaryValue* parameters) { base::DictionaryValue* parameters) {
parameters->SetBoolean("enableMarketingOptIn",
base::CommandLine::ForCurrentProcess()->HasSwitch(
chromeos::switches::kEnableMarketingOptInScreen));
BaseScreenHandler::GetAdditionalParameters(parameters); BaseScreenHandler::GetAdditionalParameters(parameters);
} }
void MarketingOptInScreenHandler::HandleAllSet( void MarketingOptInScreenHandler::HandleOnGetStarted(
bool play_communications_opt_in, bool chromebook_email_opt_in) {
bool tips_communications_opt_in) { screen_->OnGetStarted(chromebook_email_opt_in);
screen_->OnAllSet(play_communications_opt_in, tips_communications_opt_in);
} }
void MarketingOptInScreenHandler::HandleSetA11yNavigationButtonsEnabled( void MarketingOptInScreenHandler::HandleSetA11yNavigationButtonsEnabled(
......
...@@ -61,8 +61,7 @@ class MarketingOptInScreenHandler : public BaseScreenHandler, ...@@ -61,8 +61,7 @@ class MarketingOptInScreenHandler : public BaseScreenHandler,
void GetAdditionalParameters(base::DictionaryValue* parameters) override; void GetAdditionalParameters(base::DictionaryValue* parameters) override;
// WebUI event handlers. // WebUI event handlers.
void HandleAllSet(bool play_communications_opt_in, void HandleOnGetStarted(bool chromebook_email_opt_in);
bool tips_communications_opt_in);
void HandleSetA11yNavigationButtonsEnabled(bool enabled); void HandleSetA11yNavigationButtonsEnabled(bool enabled);
MarketingOptInScreen* screen_ = nullptr; MarketingOptInScreen* screen_ = nullptr;
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "chrome/common/chrome_features.h" #include "chrome/common/chrome_features.h"
#include "base/command_line.h" #include "base/command_line.h"
#include "base/feature_list.h"
#include "base/strings/string_split.h" #include "base/strings/string_split.h"
#include "build/build_config.h" #include "build/build_config.h"
#include "chrome/common/chrome_switches.h" #include "chrome/common/chrome_switches.h"
...@@ -724,6 +725,10 @@ const base::Feature kQuickUnlockPin{"QuickUnlockPin", ...@@ -724,6 +725,10 @@ const base::Feature kQuickUnlockPin{"QuickUnlockPin",
const base::Feature kQuickUnlockPinSignin{"QuickUnlockPinSignin", const base::Feature kQuickUnlockPinSignin{"QuickUnlockPinSignin",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
// Enables or disables the marketing opt-in screen in OOBE
const base::Feature kOobeMarketingScreen{"OobeMarketingScreen",
base::FEATURE_ENABLED_BY_DEFAULT};
// Enables or disables fingerprint quick unlock. // Enables or disables fingerprint quick unlock.
const base::Feature kQuickUnlockFingerprint{"QuickUnlockFingerprint", const base::Feature kQuickUnlockFingerprint{"QuickUnlockFingerprint",
base::FEATURE_DISABLED_BY_DEFAULT}; base::FEATURE_DISABLED_BY_DEFAULT};
......
...@@ -449,6 +449,9 @@ COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kQuickUnlockPin; ...@@ -449,6 +449,9 @@ COMPONENT_EXPORT(CHROME_FEATURES) extern const base::Feature kQuickUnlockPin;
COMPONENT_EXPORT(CHROME_FEATURES) COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kQuickUnlockPinSignin; extern const base::Feature kQuickUnlockPinSignin;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kOobeMarketingScreen;
COMPONENT_EXPORT(CHROME_FEATURES) COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kQuickUnlockFingerprint; extern const base::Feature kQuickUnlockFingerprint;
......
...@@ -267,9 +267,6 @@ const char kEnableHoudini[] = "enable-houdini"; ...@@ -267,9 +267,6 @@ const char kEnableHoudini[] = "enable-houdini";
// Enables the use of Houdini 64-bit library for ARM binary translation. // Enables the use of Houdini 64-bit library for ARM binary translation.
const char kEnableHoudini64[] = "enable-houdini64"; const char kEnableHoudini64[] = "enable-houdini64";
// Enables the marketing opt-in screen in OOBE.
const char kEnableMarketingOptInScreen[] = "enable-market-opt-in";
// Enables the use of NDK translation library for ARM binary translation. // Enables the use of NDK translation library for ARM binary translation.
const char kEnableNdkTranslation[] = "enable-ndk-translation"; const char kEnableNdkTranslation[] = "enable-ndk-translation";
......
...@@ -112,8 +112,6 @@ COMPONENT_EXPORT(CHROMEOS_CONSTANTS) ...@@ -112,8 +112,6 @@ COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kEnableExtensionAssetsSharing[]; extern const char kEnableExtensionAssetsSharing[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kEnableHoudini[]; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kEnableHoudini[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kEnableHoudini64[]; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kEnableHoudini64[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kEnableMarketingOptInScreen[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kEnableNdkTranslation[]; COMPONENT_EXPORT(CHROMEOS_CONSTANTS) extern const char kEnableNdkTranslation[];
COMPONENT_EXPORT(CHROMEOS_CONSTANTS) COMPONENT_EXPORT(CHROMEOS_CONSTANTS)
extern const char kEnableRequestTabletSite[]; extern const char kEnableRequestTabletSite[];
......
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