Commit 7243c1a8 authored by Scott Chen's avatar Scott Chen Committed by Commit Bot

Nux Onboarding: make showing of email-interstitial configurable

Bug: 874153
Change-Id: Ib83df9d655ed113084d058e846101b8ddb548b52
Reviewed-on: https://chromium-review.googlesource.com/c/1313283
Commit-Queue: Scott Chen <scottchen@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#605560}
parent ec93e110
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
<link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html">
<link rel="import" href="navigation_behavior.html"> <link rel="import" href="navigation_behavior.html">
<link rel="import" href="shared/action_link_style_css.html"> <link rel="import" href="shared/action_link_style_css.html">
<link rel="import" href="shared/i18n_setup.html">
<link rel="import" href="shared/onboarding_background.html"> <link rel="import" href="shared/onboarding_background.html">
<link rel="import" href="shared/splash_pages_shared_css.html"> <link rel="import" href="shared/splash_pages_shared_css.html">
<link rel="import" href="welcome_browser_proxy.html"> <link rel="import" href="welcome_browser_proxy.html">
......
...@@ -7,9 +7,9 @@ Polymer({ ...@@ -7,9 +7,9 @@ Polymer({
behaviors: [welcome.NavigationBehavior], behaviors: [welcome.NavigationBehavior],
// TODO(scottchen): read this from a nux onboarding feature param via /** @private {boolean} */
// loadTimeData. shouldShowEmailInterstitial_:
shouldShowEmailInterstitial_: true, loadTimeData.getBoolean('showEmailInterstitial'),
/** /**
* When the user clicks sign-in, check whether or not they previously * When the user clicks sign-in, check whether or not they previously
......
...@@ -40,9 +40,8 @@ Polymer({ ...@@ -40,9 +40,8 @@ Polymer({
/** @private {NuxOnboardingModules} */ /** @private {NuxOnboardingModules} */
modules_: { modules_: {
'new-user': loadTimeData.getString('new_user_modules').split(','), 'new-user': loadTimeData.getString('newUserModules').split(','),
'returning-user': 'returning-user': loadTimeData.getString('returningUserModules').split(','),
loadTimeData.getString('returning_user_modules').split(','),
}, },
properties: { properties: {
......
...@@ -19,5 +19,7 @@ const base::FeatureParam<std::string> kNuxOnboardingNewUserModules{ ...@@ -19,5 +19,7 @@ const base::FeatureParam<std::string> kNuxOnboardingNewUserModules{
"nux-email,nux-google-apps,nux-set-as-default,signin-view"}; "nux-email,nux-google-apps,nux-set-as-default,signin-view"};
const base::FeatureParam<std::string> kNuxOnboardingReturningUserModules{ const base::FeatureParam<std::string> kNuxOnboardingReturningUserModules{
&kNuxOnboardingFeature, "returning-user-modules", "nux-set-as-default"}; &kNuxOnboardingFeature, "returning-user-modules", "nux-set-as-default"};
const base::FeatureParam<bool> kNuxOnboardingShowEmailInterstitial{
&kNuxOnboardingFeature, "show-email-interstitial", true};
} // namespace nux } // namespace nux
...@@ -18,6 +18,7 @@ extern const base::Feature kNuxOnboardingFeature; ...@@ -18,6 +18,7 @@ extern const base::Feature kNuxOnboardingFeature;
extern const base::FeatureParam<std::string> kNuxOnboardingNewUserModules; extern const base::FeatureParam<std::string> kNuxOnboardingNewUserModules;
extern const base::FeatureParam<std::string> kNuxOnboardingReturningUserModules; extern const base::FeatureParam<std::string> kNuxOnboardingReturningUserModules;
extern const base::FeatureParam<bool> kNuxOnboardingShowEmailInterstitial;
} // namespace nux } // namespace nux
......
...@@ -27,6 +27,8 @@ const base::FeatureParam<std::string> ...@@ -27,6 +27,8 @@ const base::FeatureParam<std::string>
kNuxOnboardingForceEnabledReturningUserModules = { kNuxOnboardingForceEnabledReturningUserModules = {
&kNuxOnboardingForceEnabled, "returning-user-modules", &kNuxOnboardingForceEnabled, "returning-user-modules",
"nux-set-as-default"}; "nux-set-as-default"};
const base::FeatureParam<bool> kNuxOnboardingForceEnabledShowEmailInterstitial =
{&kNuxOnboardingForceEnabled, "show-email-interstitial", true};
bool IsNuxOnboardingEnabled(Profile* profile) { bool IsNuxOnboardingEnabled(Profile* profile) {
if (base::FeatureList::IsEnabled(nux::kNuxOnboardingForceEnabled)) { if (base::FeatureList::IsEnabled(nux::kNuxOnboardingForceEnabled)) {
...@@ -59,10 +61,14 @@ base::DictionaryValue GetNuxOnboardingModules(Profile* profile) { ...@@ -59,10 +61,14 @@ base::DictionaryValue GetNuxOnboardingModules(Profile* profile) {
kNuxOnboardingForceEnabledNewUserModules.Get()); kNuxOnboardingForceEnabledNewUserModules.Get());
modules.SetString("returning-user", modules.SetString("returning-user",
kNuxOnboardingForceEnabledReturningUserModules.Get()); kNuxOnboardingForceEnabledReturningUserModules.Get());
modules.SetBoolean("show-email-interstitial",
kNuxOnboardingForceEnabledShowEmailInterstitial.Get());
} else { // This means nux::kNuxOnboardingFeature is enabled. } else { // This means nux::kNuxOnboardingFeature is enabled.
modules.SetString("new-user", kNuxOnboardingNewUserModules.Get()); modules.SetString("new-user", kNuxOnboardingNewUserModules.Get());
modules.SetString("returning-user", modules.SetString("returning-user",
kNuxOnboardingReturningUserModules.Get()); kNuxOnboardingReturningUserModules.Get());
modules.SetBoolean("show-email-interstitial",
kNuxOnboardingShowEmailInterstitial.Get());
} }
return modules; return modules;
......
...@@ -22,6 +22,8 @@ extern const base::FeatureParam<std::string> ...@@ -22,6 +22,8 @@ extern const base::FeatureParam<std::string>
kNuxOnboardingForceEnabledNewUserModules; kNuxOnboardingForceEnabledNewUserModules;
extern const base::FeatureParam<std::string> extern const base::FeatureParam<std::string>
kNuxOnboardingForceEnabledReturningUserModules; kNuxOnboardingForceEnabledReturningUserModules;
extern const base::FeatureParam<bool>
kNuxOnboardingForceEnabledShowEmailInterstitial;
bool IsNuxOnboardingEnabled(Profile* profile); bool IsNuxOnboardingEnabled(Profile* profile);
......
...@@ -172,12 +172,16 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url) ...@@ -172,12 +172,16 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url)
web_ui->AddMessageHandler(std::make_unique<nux::SetAsDefaultHandler>()); web_ui->AddMessageHandler(std::make_unique<nux::SetAsDefaultHandler>());
html_source->AddString( html_source->AddString(
"new_user_modules", "newUserModules",
nux::GetNuxOnboardingModules(profile).FindKey("new-user")->GetString()); nux::GetNuxOnboardingModules(profile).FindKey("new-user")->GetString());
html_source->AddString("returning_user_modules", html_source->AddString("returningUserModules",
nux::GetNuxOnboardingModules(profile) nux::GetNuxOnboardingModules(profile)
.FindKey("returning-user") .FindKey("returning-user")
->GetString()); ->GetString());
html_source->AddBoolean("showEmailInterstitial",
nux::GetNuxOnboardingModules(profile)
.FindKey("show-email-interstitial")
->GetBool());
} else if (kIsBranded && is_dice) { } else if (kIsBranded && is_dice) {
// Use special layout if the application is branded and DICE is enabled. // Use special layout if the application is branded and DICE is enabled.
html_source->AddLocalizedString("headerText", IDS_WELCOME_HEADER); html_source->AddLocalizedString("headerText", IDS_WELCOME_HEADER);
......
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