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