Commit d2d64c9f authored by Scott Chen's avatar Scott Chen Committed by Commit Bot

NUX Onboarding: add sign-in function to landing page.

Bug: 874142
Change-Id: Ibe260cf8d4f2c8a52808a207e25eb067206dc3ff
Reviewed-on: https://chromium-review.googlesource.com/1239167
Commit-Queue: Scott Chen <scottchen@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593701}
parent 49da3db8
......@@ -67,6 +67,8 @@
<structure name="IDR_WELCOME_ONBOARDING_WELCOME_NAVIGATION_BEHAVIOR_JS" file="resources\welcome\onboarding_welcome\navigation_behavior.js" type="chrome_html" preprocess="true"/>
<structure name="IDR_WELCOME_ONBOARDING_WELCOME_WELCOME_APP_HTML" file="resources\welcome\onboarding_welcome\welcome_app.html" type="chrome_html" preprocess="true"/>
<structure name="IDR_WELCOME_ONBOARDING_WELCOME_WELCOME_APP_JS" file="resources\welcome\onboarding_welcome\welcome_app.js" type="chrome_html" preprocess="true"/>
<structure name="IDR_WELCOME_ONBOARDING_WELCOME_WELCOME_BROWSER_PROXY_HTML" file="resources\welcome\onboarding_welcome\welcome_browser_proxy.html" type="chrome_html"/>
<structure name="IDR_WELCOME_ONBOARDING_WELCOME_WELCOME_BROWSER_PROXY_JS" file="resources\welcome\onboarding_welcome\welcome_browser_proxy.js" type="chrome_html"/>
<structure name="IDR_WELCOME_ONBOARDING_WELCOME_WELCOME_CSS" file="resources\welcome\onboarding_welcome\welcome.css" type="chrome_html" preprocess="true"/>
<structure name="IDR_WELCOME_ONBOARDING_WELCOME_WELCOME_HTML" file="resources\welcome\onboarding_welcome\welcome.html" type="chrome_html" preprocess="true"/>
</if>
......
......@@ -4,6 +4,7 @@
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.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="welcome_browser_proxy.html">
<dom-module id="landing-view">
<template>
......
......@@ -9,7 +9,7 @@ Polymer({
/** @private */
onExistingUserClick_: function() {
this.navigateTo(welcome.Routes.RETURNING_USER, 1);
welcome.WelcomeBrowserProxyImpl.getInstance().handleActivateSignIn();
},
/** @private */
......
......@@ -41,7 +41,7 @@ Polymer({
// If the specified step doesn't exist, that means there are no more steps.
// In that case, go to NTP.
if (!this.$$('#step-' + step))
window.location.replace('chrome://newtab');
welcome.WelcomeBrowserProxyImpl.getInstance().goToNewTabPage();
else // Otherwise, go to the chosen step of that route.
this.$.viewManager.switchView('step-' + step);
},
......
<link rel="import" href="chrome://resources/html/cr.html">
<script src="welcome_browser_proxy.js"></script>
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
/**
* @fileoverview A helper object used by the welcome page to interact with
* the browser.
*/
cr.define('welcome', function() {
/** @interface */
class WelcomeBrowserProxy {
handleActivateSignIn() {}
goToNewTabPage() {}
}
/** @implements {welcome.WelcomeBrowserProxy} */
class WelcomeBrowserProxyImpl {
/** @override */
handleActivateSignIn() {
// TODO(scottchen): add code to direct back to /welcome/returning-user
// after user finishes signing in.
chrome.send('handleActivateSignIn');
}
/** @override */
goToNewTabPage() {
window.location.replace('chrome://newtab');
}
}
cr.addSingletonGetter(WelcomeBrowserProxyImpl);
return {
WelcomeBrowserProxy: WelcomeBrowserProxy,
WelcomeBrowserProxyImpl: WelcomeBrowserProxyImpl,
};
});
......@@ -92,7 +92,12 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url)
"welcome_app.html", IDR_WELCOME_ONBOARDING_WELCOME_WELCOME_APP_HTML);
html_source->AddResourcePath("welcome_app.js",
IDR_WELCOME_ONBOARDING_WELCOME_WELCOME_APP_JS);
html_source->AddResourcePath(
"welcome_browser_proxy.html",
IDR_WELCOME_ONBOARDING_WELCOME_WELCOME_BROWSER_PROXY_HTML);
html_source->AddResourcePath(
"welcome_browser_proxy.js",
IDR_WELCOME_ONBOARDING_WELCOME_WELCOME_BROWSER_PROXY_JS);
} else if (kIsBranded && is_dice) {
// Use special layout if the application is branded and DICE is enabled.
// Otherwise use the default layout.
......
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