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

[signin] dice welcome page updates

This CL changes the look of the welcome page for profiles that have DICE
fully enabled.

Bug: 782155
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Ife6f0d2cc661b15d2cf9be9a8577b090707ff57d
Reviewed-on: https://chromium-review.googlesource.com/753386
Commit-Queue: Scott Chen <scottchen@chromium.org>
Reviewed-by: default avatarDemetrios Papadopoulos <dpapad@chromium.org>
Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517456}
parent a001a5d9
...@@ -1213,6 +1213,15 @@ Please check your email at <ph name="ACCOUNT_EMAIL">$2<ex>jane.doe@example.com</ ...@@ -1213,6 +1213,15 @@ Please check your email at <ph name="ACCOUNT_EMAIL">$2<ex>jane.doe@example.com</
<message name="IDS_WELCOME_HEADER_AFTER_FIRST_RUN" desc="A message which will appear as the header on the Welcome UI if the user has run Chromium before."> <message name="IDS_WELCOME_HEADER_AFTER_FIRST_RUN" desc="A message which will appear as the header on the Welcome UI if the user has run Chromium before.">
Take Chromium everywhere Take Chromium everywhere
</message> </message>
<message name="IDS_DICE_WELCOME_SECOND_HEADER" desc="A second message which will appear as the header on the Welcome UI if the user has never run Chrome before.">
Web browsing with Google smarts
</message>
<message name="IDS_DICE_WELCOME_DECLINE_BUTTON" desc="A button on the welcome page which declines the offer to sign in to Chrome.">
Not now
</message>
<message name="IDS_DICE_WELCOME_DESCRIPTION" desc="A message on the welcome page explaining the purpose of signing in.">
Sign in for a personalized browsing experience, synced across devices
</message>
</if> </if>
<!-- Windows 10 Welcome page strings --> <!-- Windows 10 Welcome page strings -->
......
...@@ -1230,6 +1230,15 @@ Please check your email at <ph name="ACCOUNT_EMAIL">$2<ex>jane.doe@example.com</ ...@@ -1230,6 +1230,15 @@ Please check your email at <ph name="ACCOUNT_EMAIL">$2<ex>jane.doe@example.com</
<message name="IDS_WELCOME_HEADER_AFTER_FIRST_RUN" desc="A message which will appear as the header on the Welcome UI if the user has run Chrome before."> <message name="IDS_WELCOME_HEADER_AFTER_FIRST_RUN" desc="A message which will appear as the header on the Welcome UI if the user has run Chrome before.">
Take Chrome everywhere Take Chrome everywhere
</message> </message>
<message name="IDS_DICE_WELCOME_SECOND_HEADER" desc="A second message which will appear as the header on the Welcome UI if the user has never run Chrome before.">
Web browsing with Google smarts
</message>
<message name="IDS_DICE_WELCOME_DECLINE_BUTTON" desc="A button on the welcome page which declines the offer to sign in to Chrome.">
Not now
</message>
<message name="IDS_DICE_WELCOME_DESCRIPTION" desc="A message on the welcome page explaining the purpose of signing in.">
Sign in for a personalized browsing experience, synced across devices
</message>
</if> </if>
<!-- Windows 10 Welcome page strings --> <!-- Windows 10 Welcome page strings -->
......
...@@ -66,7 +66,10 @@ ...@@ -66,7 +66,10 @@
<structure name="IDR_WELCOME_JS" file="resources\welcome\welcome.js" type="chrome_html" preprocess="true"/> <structure name="IDR_WELCOME_JS" file="resources\welcome\welcome.js" type="chrome_html" preprocess="true"/>
<structure name="IDR_DICE_WELCOME_CSS" file="resources\welcome\dice_welcome\welcome.css" type="chrome_html" preprocess="true"/> <structure name="IDR_DICE_WELCOME_CSS" file="resources\welcome\dice_welcome\welcome.css" type="chrome_html" preprocess="true"/>
<structure name="IDR_DICE_WELCOME_HTML" file="resources\welcome\dice_welcome\welcome.html" type="chrome_html" preprocess="true"/> <structure name="IDR_DICE_WELCOME_HTML" file="resources\welcome\dice_welcome\welcome.html" type="chrome_html" preprocess="true"/>
<structure name="IDR_DICE_WELCOME_JS" file="resources\welcome\dice_welcome\welcome.js" type="chrome_html" preprocess="true"/> <structure name="IDR_DICE_WELCOME_BROWSER_PROXY_HTML" file="resources\welcome\dice_welcome\welcome_browser_proxy.html" type="chrome_html" preprocess="true"/>
<structure name="IDR_DICE_WELCOME_BROWSER_PROXY_JS" file="resources\welcome\dice_welcome\welcome_browser_proxy.js" type="chrome_html" preprocess="true"/>
<structure name="IDR_DICE_WELCOME_APP_HTML" file="resources\welcome\dice_welcome\welcome_app.html" type="chrome_html" preprocess="true"/>
<structure name="IDR_DICE_WELCOME_APP_JS" file="resources\welcome\dice_welcome\welcome_app.js" type="chrome_html" preprocess="true"/>
</if> </if>
<if expr="is_win"> <if expr="is_win">
<structure name="IDR_WELCOME_WIN10_CSS" file="resources\welcome\welcome_win10.css" type="chrome_html" /> <structure name="IDR_WELCOME_WIN10_CSS" file="resources\welcome\welcome_win10.css" type="chrome_html" />
......
# Copyright 2016 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.
{
'targets': [
{
'target_name': 'welcome_app',
'dependencies': [
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
'<(EXTERNS_GYP):web_animations',
'welcome_browser_proxy',
],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
{
'target_name': 'welcome_browser_proxy',
'dependencies': [
'<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
'<(EXTERNS_GYP):chrome_send',
],
'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
},
],
}
...@@ -4,214 +4,14 @@ ...@@ -4,214 +4,14 @@
body { body {
align-items: center; align-items: center;
color: var(--paper-grey-900); color: var(--google-grey-700);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
font-size: 100%; font-size: 100%;
justify-content: center; justify-content: center;
margin: 0; margin: 0;
min-height: 100vh; min-height: 100vh;
}
@keyframes slideUpContent {
from {
transform: translateY(186px);
}
}
@keyframes fadeIn {
from {
opacity: 0;
}
}
@keyframes fadeOut {
to {
opacity: 0;
}
}
@keyframes fadeInAndSlideUp {
from {
opacity: 0;
transform: translateY(8px);
}
}
@keyframes spin {
from {
transform: rotate(1440deg) scale(0.8);
}
}
@keyframes fadeInAndSlideDownShadow {
from {
opacity: .6;
top: 0;
}
}
@keyframes scaleUp {
0% {
transform: scale(.8);
}
}
@keyframes colorize {
from {
filter: grayscale(100%) brightness(128%) contrast(20%) brightness(161%);
opacity: .6;
}
}
@keyframes bounce {
0% {
transform: matrix3d(0.8, 0, 0, 0, 0, 0.8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
7.61% {
transform: matrix3d(0.907, 0, 0, 0, 0, 0.907, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
11.41% {
transform: matrix3d(0.948, 0, 0, 0, 0, 0.948, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
15.12% {
transform: matrix3d(0.976, 0, 0, 0, 0, 0.976, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
18.92% {
transform: matrix3d(0.996, 0, 0, 0, 0, 0.996, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
22.72% {
transform: matrix3d(1.008, 0, 0, 0, 0, 1.008, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
30.23% {
transform: matrix3d(1.014, 0, 0, 0, 0, 1.014, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
50.25% {
transform: matrix3d(1.003, 0, 0, 0, 0, 1.003, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
70.27% {
transform: matrix3d(0.999, 0, 0, 0, 0, 0.999, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
100% {
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
}
.content {
height: 100%;
overflow-y: hidden;
}
.slider {
align-items: center;
animation: slideUpContent 600ms 1.8s cubic-bezier(.4, .2, 0, 1) both;
display: flex;
flex: 1;
flex-direction: column;
justify-content: center;
max-width: 500px;
}
.heading {
animation: fadeInAndSlideUp 600ms 1.9s cubic-bezier(.4, .2, 0, 1) both;
font-size: 2.125em;
margin-bottom: .25em;
margin-top: 1.5em;
text-align: center;
}
.subheading {
animation: fadeInAndSlideUp 600ms 1.9s cubic-bezier(.4, .2, 0, 1) both;
color: #939393;
font-size: 1em;
font-weight: 500;
margin-top: .25em;
text-align: center;
}
.logo {
animation: fadeIn 600ms both, bounce 1s 600ms linear both;
height: 96px;
position: relative;
width: 96px;
}
.logo-icon {
animation: spin 2.4s cubic-bezier(.4, .2, 0, 1) both,
colorize 300ms 700ms linear both;
background-image: -webkit-image-set(url(chrome://welcome/logo.png) 1x,
url(chrome://welcome/logo2x.png) 2x);
background-size: 100%;
height: 96px;
width: 96px;
}
.logo-shadow {
animation: fadeInAndSlideDownShadow 300ms 600ms both;
background: rgba(0, 0, 0, .2);
border-radius: 50%;
filter: blur(16px);
height: 96px;
position: absolute;
top: 16px;
width: 96px;
z-index: -1;
}
.signin {
animation: fadeInAndSlideUp 600ms 2s cubic-bezier(.4, .2, 0, 1) both;
margin-top: 3em;
text-align: left;
}
.signin-description {
font-size: .875em;
line-height: 1.725em;
max-width: 344px;
}
.signin-buttons {
align-items: center;
display: flex;
flex-direction: column;
margin-top: 2em;
}
.action {
-webkit-font-smoothing: antialiased;
background: var(--google-blue-500);
border-radius: 2px;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
color: white;
font-size: .8125em;
font-weight: 500;
line-height: 2.25rem;
padding: 0 1.5em;
transition: 300ms cubic-bezier(.4, .2, 0, 1);
will-change: box-shadow;
}
.action:hover {
background: var(--paper-blue-a400);
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .24);
}
.action:active {
background: var(--google-blue-500);
}
.action.keyboard-focus {
background: var(--google-blue-700);
}
.link {
color: var(--google-blue-700);
display: inline-block;
font-size: .8125em;
margin: 1.5em;
text-align: center; text-align: center;
text-decoration: none;
} }
.watermark { .watermark {
......
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<title>$i18n{headerText}</title> <title>$i18n{headerText}</title>
<link rel="import" href="chrome://resources/html/polymer.html"> <link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html">
<link rel="import" href="welcome_app.html">
<link rel="import" href="chrome://resources/html/cr.html"> <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css">
<link rel="import" href="chrome://resources/html/util.html"> <link rel="stylesheet" href="chrome://welcome/welcome.css">
<link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> </head>
<link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html"> <body>
<welcome-app></welcome-app>
<link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css"> <div class="watermark"></div>
<link rel="stylesheet" href="chrome://welcome/welcome.css"> </body>
</head>
<body>
<div class="content">
<div class="slider">
<div class="logo">
<div class="logo-icon"></div>
<div class="logo-shadow"></div>
</div>
<div class="heading">$i18n{headerText}</div>
<if expr="_google_chrome">
<div class="subheading">$i18n{subheaderText}</div>
</if>
<div class="signin">
<div class="signin-description">$i18n{descriptionText}</div>
<div class="signin-buttons">
<paper-button class="action" id="accept-button">
$i18n{acceptText}
</paper-button>
<a href="#" class="link" id="decline-button">$i18n{declineText}</a>
</div>
</div>
</div>
</div>
<div class="watermark"></div>
<script src="chrome://welcome/welcome.js"></script>
</body>
</html> </html>
// Copyright 2017 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.
cr.define('welcome', function() {
'use strict';
function onAccept(e) {
chrome.send('handleActivateSignIn');
}
function onDecline(e) {
chrome.send('handleUserDecline');
e.preventDefault();
}
function initialize() {
$('accept-button').addEventListener('click', onAccept);
$('decline-button').addEventListener('click', onDecline);
var logo = document.querySelector('.logo-icon');
logo.onclick = function(e) {
logo.animate(
{
transform: ['none', 'rotate(-10turn)'],
},
/** @type {!KeyframeEffectOptions} */ ({
duration: 500,
easing: 'cubic-bezier(1, 0, 0, 1)',
}));
};
}
return {initialize: initialize};
});
document.addEventListener('DOMContentLoaded', welcome.initialize);
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/html/action_link.html">
<link rel="import" href="chrome://resources/html/action_link_css.html">
<link rel="import" href="chrome://resources/html/cr.html">
<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="welcome_browser_proxy.html">
<dom-module id="welcome-app">
<template>
<style include="action-link">
@keyframes slideUpContent {
from {
transform: translateY(120px);
}
}
@keyframes fadeIn {
from {
opacity: 0;
}
}
@keyframes fadeInAndSlideUp {
from {
opacity: 0;
transform: translateY(8px);
}
}
@keyframes fadeOutAndSlideUp {
to {
height: 0;
opacity: 0;
transform: translateY(-8px);
}
}
@keyframes spin {
from {
transform: rotate(1440deg) scale(0.8);
}
}
@keyframes colorize {
from {
filter: grayscale(100%) brightness(128%) contrast(20%) brightness(161%);
opacity: .6;
}
}
@keyframes bounce {
0% {
transform: matrix3d(0.8, 0, 0, 0, 0, 0.8, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
7.61% {
transform: matrix3d(0.907, 0, 0, 0, 0, 0.907, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
11.41% {
transform: matrix3d(0.948, 0, 0, 0, 0, 0.948, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
15.12% {
transform: matrix3d(0.976, 0, 0, 0, 0, 0.976, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
18.92% {
transform: matrix3d(0.996, 0, 0, 0, 0, 0.996, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
22.72% {
transform: matrix3d(1.008, 0, 0, 0, 0, 1.008, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
30.23% {
transform: matrix3d(1.014, 0, 0, 0, 0, 1.014, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
50.25% {
transform: matrix3d(1.003, 0, 0, 0, 0, 1.003, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
70.27% {
transform: matrix3d(0.999, 0, 0, 0, 0, 0.999, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
100% {
transform: matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
}
}
.slider {
align-items: center;
animation: slideUpContent 600ms 3s cubic-bezier(.4, .2, 0, 1) both;
display: flex;
flex: 1;
flex-direction: column;
justify-content: center;
max-width: 500px;
}
.heading-container {
animation: fadeInAndSlideUp 1s 600ms cubic-bezier(.4, .2, 0, 1) both;
color: var(--paper-grey-800);
font-size: 2.5em;
line-height: 1em;
margin-bottom: 0.25em;
margin-top: 1.5em;
position: relative;
}
.heading {
animation: fadeOutAndSlideUp 600ms 2.6s cubic-bezier(.4, .2, 0, 1) forwards;
/* Makes sure fading-in/out doesn't impact the logo position. */
position: absolute;
}
.second-heading {
animation: fadeInAndSlideUp 600ms 3s cubic-bezier(.4, .2, 0, 1) both;
font-size: 0.6em;
}
#logoWrapper {
animation: fadeIn 600ms both, bounce 1s 600ms linear both;
height: 96px;
position: relative;
width: 96px;
}
#logo {
animation: spin 2.4s cubic-bezier(.4, .2, 0, 1) both,
colorize 300ms 700ms linear both;
background-image: -webkit-image-set(url(chrome://welcome/logo.png) 1x,
url(chrome://welcome/logo2x.png) 2x);
background-size: 100%;
height: 96px;
width: 96px;
}
.signin {
animation: fadeInAndSlideUp 600ms 3s cubic-bezier(.4, .2, 0, 1) both;
}
.signin-description {
font-size: 1em;
line-height: 1.725em;
max-width: 344px;
}
.signin-buttons {
align-items: center;
display: flex;
flex-direction: row;
font-size: .8125em;
font-weight: 500;
justify-content: space-between;
margin-top: 2.5em;
text-transform: uppercase;
}
#acceptButton {
-webkit-font-smoothing: antialiased;
background: var(--google-blue-500);
border-radius: 2px;
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1);
color: white;
line-height: 2.25rem;
padding: 0 2em;
transition: 300ms cubic-bezier(.4, .2, 0, 1);
will-change: box-shadow;
}
#acceptButton:hover {
background: var(--paper-blue-a400);
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1), 0 1px 2px rgba(0, 0, 0, .24);
}
#acceptButton.keyboard-focus {
background: var(--google-blue-700);
}
#declineButton {
color: var(--paper-grey-800);
display: inline-block;
margin: 1.5em;
text-decoration: none;
}
</style>
<div class="slider">
<div id="logoWrapper">
<div id="logo" on-tap="onLogoTap_"></div>
</div>
<div class="heading-container">
<div class="heading">$i18n{headerText}</div>
<div class="second-heading">$i18n{secondHeaderText}</div>
</div>
<div class="signin">
<div class="signin-description">$i18n{descriptionText}</div>
<div class="signin-buttons">
<a is="action-link" id="declineButton" on-tap="onDecline_">
$i18n{declineText}
</a>
<paper-button id="acceptButton" on-tap="onAccept_">
$i18n{acceptText}
</paper-button>
</div>
</div>
</div>
</template>
<script src="welcome_app.js"></script>
</dom-module>
\ No newline at end of file
// Copyright 2017 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.
Polymer({
is: 'welcome-app',
welcomeBrowserProxy_: null,
/** @override */
ready: function() {
this.welcomeBrowserProxy_ = welcome.WelcomeBrowserProxyImpl.getInstance();
},
/** @private */
onAccept_: function() {
this.welcomeBrowserProxy_.handleActivateSignIn();
},
/** @private */
onDecline_: function() {
this.welcomeBrowserProxy_.handleUserDecline();
},
/** @private */
onLogoTap_: function() {
this.$.logo.animate(
{
transform: ['none', 'rotate(-10turn)'],
},
/** @type {!KeyframeEffectOptions} */ ({
duration: 500,
easing: 'cubic-bezier(1, 0, 0, 1)',
}));
},
});
<link rel="import" href="chrome://resources/html/cr.html">
<script src="welcome_browser_proxy.js"></script>
// Copyright 2017 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() {}
handleUserDecline() {}
}
/** @implements {welcome.WelcomeBrowserProxy} */
class WelcomeBrowserProxyImpl {
/** @override */
handleActivateSignIn() {
chrome.send('handleActivateSignIn');
}
/** @override */
handleUserDecline() {
chrome.send('handleUserDecline');
}
}
cr.addSingletonGetter(WelcomeBrowserProxyImpl);
return {
WelcomeBrowserProxy: WelcomeBrowserProxy,
WelcomeBrowserProxyImpl: WelcomeBrowserProxyImpl,
};
});
...@@ -19,6 +19,15 @@ ...@@ -19,6 +19,15 @@
#include "ui/base/l10n/l10n_util.h" #include "ui/base/l10n/l10n_util.h"
#include "ui/resources/grit/webui_resources.h" #include "ui/resources/grit/webui_resources.h"
namespace {
const bool kIsBranded =
#if defined(GOOGLE_CHROME_BUILD)
true;
#else
false;
#endif
}
WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url) WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url)
: content::WebUIController(web_ui) { : content::WebUIController(web_ui) {
Profile* profile = Profile::FromWebUI(web_ui); Profile* profile = Profile::FromWebUI(web_ui);
...@@ -44,32 +53,46 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url) ...@@ -44,32 +53,46 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url)
(net::GetValueForKeyInQuery(url, "variant", &value) && (net::GetValueForKeyInQuery(url, "variant", &value) &&
value == "everywhere"); value == "everywhere");
int header_id = is_everywhere_variant ? IDS_WELCOME_HEADER_AFTER_FIRST_RUN bool is_dice = signin::IsDiceEnabledForProfile(profile->GetPrefs());
: IDS_WELCOME_HEADER;
html_source->AddString("headerText", l10n_util::GetStringUTF16(header_id));
// The subheader describes the browser as being "by Google", so we only show // There are multiple possible configurations that affects the layout, but
// it in the "Welcome to Chrome" variant, and only on branded builds. // first add resources that are shared across all layouts.
#if defined(GOOGLE_CHROME_BUILD)
base::string16 subheader =
is_everywhere_variant ? base::string16()
: l10n_util::GetStringUTF16(IDS_WELCOME_SUBHEADER);
html_source->AddString("subheaderText", subheader);
#endif
html_source->AddLocalizedString("descriptionText", IDS_WELCOME_DESCRIPTION);
html_source->AddLocalizedString("acceptText", IDS_WELCOME_ACCEPT_BUTTON); html_source->AddLocalizedString("acceptText", IDS_WELCOME_ACCEPT_BUTTON);
html_source->AddLocalizedString("declineText", IDS_WELCOME_DECLINE_BUTTON);
html_source->AddResourcePath("logo.png", IDR_PRODUCT_LOGO_128); html_source->AddResourcePath("logo.png", IDR_PRODUCT_LOGO_128);
html_source->AddResourcePath("logo2x.png", IDR_PRODUCT_LOGO_256); html_source->AddResourcePath("logo2x.png", IDR_PRODUCT_LOGO_256);
html_source->AddResourcePath("watermark.svg", IDR_WEBUI_IMAGES_GOOGLE_LOGO); html_source->AddResourcePath("watermark.svg", IDR_WEBUI_IMAGES_GOOGLE_LOGO);
if (signin::IsDiceEnabledForProfile(profile->GetPrefs())) { // Use special layout if it's branded, DICE is enabled, and it's the first
html_source->AddResourcePath("welcome.js", IDR_DICE_WELCOME_JS); // run. otherwise use the default layout.
if (kIsBranded && is_dice && !is_everywhere_variant) {
html_source->AddLocalizedString("headerText", IDS_WELCOME_HEADER);
html_source->AddLocalizedString("secondHeaderText",
IDS_DICE_WELCOME_SECOND_HEADER);
html_source->AddLocalizedString("descriptionText",
IDS_DICE_WELCOME_DESCRIPTION);
html_source->AddLocalizedString("declineText",
IDS_DICE_WELCOME_DECLINE_BUTTON);
html_source->AddResourcePath("welcome_browser_proxy.html", IDR_DICE_WELCOME_BROWSER_PROXY_HTML);
html_source->AddResourcePath("welcome_browser_proxy.js", IDR_DICE_WELCOME_BROWSER_PROXY_JS);
html_source->AddResourcePath("welcome_app.html", IDR_DICE_WELCOME_APP_HTML);
html_source->AddResourcePath("welcome_app.js", IDR_DICE_WELCOME_APP_JS);
html_source->AddResourcePath("welcome.css", IDR_DICE_WELCOME_CSS); html_source->AddResourcePath("welcome.css", IDR_DICE_WELCOME_CSS);
html_source->SetDefaultResource(IDR_DICE_WELCOME_HTML); html_source->SetDefaultResource(IDR_DICE_WELCOME_HTML);
} else { } else {
// Use default layout for non-DICE, non-first run, or unbranded build.
if (kIsBranded) {
base::string16 subheader =
is_everywhere_variant
? base::string16()
: l10n_util::GetStringUTF16(IDS_WELCOME_SUBHEADER);
html_source->AddString("subheaderText", subheader);
}
int header_id = is_everywhere_variant ? IDS_WELCOME_HEADER_AFTER_FIRST_RUN
: IDS_WELCOME_HEADER;
html_source->AddString("headerText", l10n_util::GetStringUTF16(header_id));
html_source->AddLocalizedString("descriptionText", IDS_WELCOME_DESCRIPTION);
html_source->AddLocalizedString("declineText", IDS_WELCOME_DECLINE_BUTTON);
html_source->AddResourcePath("welcome.js", IDR_WELCOME_JS); html_source->AddResourcePath("welcome.js", IDR_WELCOME_JS);
html_source->AddResourcePath("welcome.css", IDR_WELCOME_CSS); html_source->AddResourcePath("welcome.css", IDR_WELCOME_CSS);
html_source->SetDefaultResource(IDR_WELCOME_HTML); html_source->SetDefaultResource(IDR_WELCOME_HTML);
......
...@@ -39,6 +39,7 @@ ...@@ -39,6 +39,7 @@
'<(DEPTH)/chrome/browser/resources/print_preview/new/compiled_resources2.gyp:*', '<(DEPTH)/chrome/browser/resources/print_preview/new/compiled_resources2.gyp:*',
'<(DEPTH)/chrome/browser/resources/settings/compiled_resources2.gyp:*', '<(DEPTH)/chrome/browser/resources/settings/compiled_resources2.gyp:*',
'<(DEPTH)/chrome/browser/resources/webapks/compiled_resources2.gyp:*', '<(DEPTH)/chrome/browser/resources/webapks/compiled_resources2.gyp:*',
'<(DEPTH)/chrome/browser/resources/welcome/dice_welcome/compiled_resources2.gyp:*',
'<(DEPTH)/ui/file_manager/compiled_resources2.gyp:*', '<(DEPTH)/ui/file_manager/compiled_resources2.gyp:*',
'<(DEPTH)/ui/webui/resources/cr_components/compiled_resources2.gyp:*', '<(DEPTH)/ui/webui/resources/cr_components/compiled_resources2.gyp:*',
'<(DEPTH)/ui/webui/resources/cr_elements/compiled_resources2.gyp:*', '<(DEPTH)/ui/webui/resources/cr_elements/compiled_resources2.gyp:*',
......
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