Commit 442a31a9 authored by Scott Chen's avatar Scott Chen Committed by Commit Bot

Navi Onboarding: go to email-interstitial even if users don't sign in

Bug: 905503
Change-Id: Ic886e1b5946ffdbca69d5cb33f573d79437b84ae
Reviewed-on: https://chromium-review.googlesource.com/c/1336752
Commit-Queue: Scott Chen <scottchen@chromium.org>
Reviewed-by: default avatarHector Carmona <hcarmona@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608603}
parent 7c27d3b0
......@@ -11,28 +11,47 @@ Polymer({
shouldShowEmailInterstitial_:
loadTimeData.getBoolean('showEmailInterstitial'),
/** @private {?welcome.WelcomeBrowserProxy} */
welcomeBrowserProxy_: null,
/** @override */
ready: function() {
this.welcomeBrowserProxy_ = welcome.WelcomeBrowserProxyImpl.getInstance();
},
/**
* When the user clicks sign-in, check whether or not they previously
* selected an email provider they prefer to use. If so, direct them back to
* the email-interstitial page, otherwise let it direct to NTP.
* @return {?string}
* @private
*/
onSignInClick_: function() {
let redirectUrl = null;
getTargetUrl_: function() {
const savedProvider =
nux.NuxEmailProxyImpl.getInstance().getSavedProvider();
if (savedProvider != undefined && this.shouldShowEmailInterstitial_) {
redirectUrl =
`chrome://welcome/email-interstitial?provider=${savedProvider}`;
return `chrome://welcome/email-interstitial?provider=${savedProvider}`;
} else {
return null;
}
},
welcome.WelcomeBrowserProxyImpl.getInstance().handleActivateSignIn(
redirectUrl);
/**
* When the user clicks sign-in, check whether or not they previously
* selected an email provider they prefer to use. If so, direct them back to
* the email-interstitial page, otherwise let it direct to NTP.
* @private
*/
onSignInClick_: function() {
this.welcomeBrowserProxy_.handleActivateSignIn(this.getTargetUrl_());
},
/** @private */
onNoThanksClick_: function() {
welcome.navigateToNextStep();
// It's safe to assume sign-view is always going to be the last step, so
// either go to the target url directly, or go to NTP directly.
const targetUrl = this.getTargetUrl_();
if (targetUrl) {
this.welcomeBrowserProxy_.goToURL(targetUrl);
} else {
this.welcomeBrowserProxy_.goToNewTabPage();
}
}
});
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