Commit 6302b21f authored by Hector Carmona's avatar Hector Carmona Committed by Commit Bot

Navi: Remove old welcome page.

This is dead code and should not be accessible by our users.

Bug: 956680
Change-Id: I2da85dbada54ea683417b8309dff46f08d1dcca4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1713443Reviewed-by: default avatarEsmael Elmoslimany <aee@chromium.org>
Commit-Queue: Hector Carmona <hcarmona@chromium.org>
Cr-Commit-Position: refs/heads/master@{#680041}
parent 8cfeb0df
......@@ -1169,9 +1169,6 @@ Please check your email at <ph name="ACCOUNT_EMAIL">$2<ex>jane.doe@example.com</
<message name="IDS_WELCOME_HEADER" desc="A message which will appear as the header on the Welcome UI if the user has never run Chromium before.">
Welcome to Chromium
</message>
<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
</message>
</if>
<!-- Native notifications for Windows 10 -->
......
......@@ -9330,22 +9330,6 @@ Please help our engineers fix this problem. Tell us what happened right before y
</message>
</if>
<!-- Welcome page (chrome://welcome) strings -->
<if expr="not chromeos">
<message name="IDS_WELCOME_SUBHEADER" desc="A message which will appear underneath the header on the Welcome UI.">
The web browser by Google, for you
</message>
<message name="IDS_WELCOME_DESCRIPTION" desc="A message on the welcome page explaining the purpose of signing in.">
Sign in to Chrome with your Google Account to get your bookmarks, history, passwords, and other settings on all your devices.
</message>
<message name="IDS_WELCOME_ACCEPT_BUTTON" desc="A button on the welcome page which accepts the offer to sign in to Chrome.">
Sign in
</message>
<message name="IDS_WELCOME_DECLINE_BUTTON" desc="A button on the welcome page which declines the offer to sign in to Chrome.">
No thanks
</message>
</if>
<!-- Windows 10 toast strings -->
<if expr="is_win">
<message name="IDS_WIN10_TOAST_BROWSE_FAST" desc="Toast message variant: browse fast.">
......
......@@ -1188,9 +1188,6 @@ Please check your email at <ph name="ACCOUNT_EMAIL">$2<ex>jane.doe@example.com</
<message name="IDS_WELCOME_HEADER" desc="A message which will appear as the header on the Welcome UI if the user has never run Chrome before.">
Welcome to Chrome
</message>
<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
</message>
</if>
<!-- Native notifications for Windows 10 -->
......
<?xml version="1.0" encoding="utf-8"?>
<grit-part>
<!-- Shared strings -->
<message name="IDS_ONBOARDING_WELCOME_GET_STARTED" desc="Label for a confirmation button to finish adding a bookmark and get the user started with using the browser.">
Get started
</message>
<message name="IDS_ONBOARDING_WELCOME_NEXT" desc="Label for a button to confirm and continue from the current onboarding step.">
Next
</message>
......@@ -90,9 +87,6 @@
<message name="IDS_ONBOARDING_WELCOME_NUX_SET_AS_DEFAULT_SUB_HEADER" desc="Sub-header for the page that prompts user to set Chrome as their default browser.">
Get Google Search and Google smarts everytime you browse
</message>
<message name="IDS_ONBOARDING_WELCOME_NUX_SET_AS_DEFAULT_SKIP" desc="The label for a button to skip setting Chrome as their default browser.">
Skip
</message>
<message name="IDS_ONBOARDING_WELCOME_NUX_SET_AS_DEFAULT_SET_AS_DEFAULT" desc="The label for a button to confirm setting Chrome as their default browser.">
Set as default
</message>
......
......@@ -67,11 +67,6 @@
</else>
</if>
</if>
<if expr="not is_android and not chromeos">
<structure name="IDR_WELCOME_CSS" file="resources\welcome\welcome.css" type="chrome_html" preprocess="true"/>
<structure name="IDR_WELCOME_HTML" file="resources\welcome\welcome.html" type="chrome_html" preprocess="true"/>
<structure name="IDR_WELCOME_JS" file="resources\welcome\welcome.js" type="chrome_html" preprocess="true"/>
</if>
<if expr="chromeos">
<structure name="IDR_FIRST_RUN_HTML" file="resources\chromeos\first_run\first_run.html" flattenhtml="true" type="chrome_html"/>
<structure name="IDR_FIRST_RUN_JS" file="resources\chromeos\first_run\first_run.js" flattenhtml="true" type="chrome_html" />
......
......@@ -88,7 +88,7 @@
<div class="illustration slide-in" aria-hidden="true"></div>
<div class="button-bar">
<cr-button id="decline-button" on-click="onDeclineClick_">
$i18n{setDefaultSkip}
$i18n{skip}
</cr-button>
<step-indicator model="[[indicatorModel]]"></step-indicator>
<cr-button class="action-button" on-click="onSetDefaultClick_">
......
/* 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. */
body {
align-items: center;
box-sizing: border-box;
color: var(--paper-grey-900);
display: flex;
flex-direction: column;
font-size: 100%;
justify-content: center;
margin: 0;
min-height: 100vh;
padding: 8px;
}
@media (prefers-color-scheme: dark) {
body {
color: var(--cr-primary-text-color);
}
}
.watermark {
-webkit-mask-image: url(chrome://resources/images/google_logo.svg);
-webkit-mask-repeat: no-repeat;
-webkit-mask-size: 100%;
animation: fadeIn 1s cubic-bezier(0, 0, .2, 1) both;
background: var(--paper-grey-400);
bottom: 24px;
height: 24px;
position: absolute;
width: 74px;
}
@media (prefers-color-scheme: dark) {
.watermark {
background: var(--cr-secondary-text-color);
}
}
@media(max-height: 608px) {
.watermark {
display: none;
}
}
<!doctype html>
<html dir="$i18n{textdirection}" lang="$i18n{language}">
<head>
<meta charset="utf-8">
<title>$i18n{headerText}</title>
<link rel="import" href="chrome://resources/html/polymer.html">
<link rel="import" href="chrome://resources/cr_elements/cr_button/cr_button.html">
<link rel="import" href="chrome://resources/cr_elements/shared_vars_css.html">
<link rel="import" href="chrome://resources/html/cr.html">
<link rel="import" href="chrome://resources/html/util.html">
<link rel="stylesheet" href="chrome://resources/css/md_colors.css">
<link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css">
<link rel="stylesheet" href="chrome://welcome/welcome.css">
<style>
@media (prefers-color-scheme: dark) {
html {
background-color: var(--md-background-color);
}
}
</style>
<dom-module id="welcome-app">
<template>
<style>
@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: rgb(95, 99, 104);
font-size: 1em;
font-weight: 500;
margin-top: .25em;
text-align: center;
}
@media (prefers-color-scheme: dark) {
.subheading {
color: var(--cr-secondary-text-color);
}
}
.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;
}
.signin-description {
font-size: .875em;
line-height: 1.725em;
max-width: 344px;
}
.signin-buttons {
align-items: center;
display: flex;
flex-direction: column;
margin: auto;
margin-top: 2em;
width: fit-content;
}
cr-button {
font-size: .8125em;
/* Makes sure the two cr-button's are the same width since they're
placed vertically. Requires parent to be "width: fit-content;". */
width: 100%;
}
#cancel {
margin-bottom: 2px; /* Prevent focus ring from being chopped. */
margin-top: 1.5em;
}
</style>
<div class="content">
<div class="slider">
<div class="logo">
<div class="logo-icon" on-click="onLogoTap_"></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">
<cr-button class="action-button" on-click="onAccept_">
$i18n{acceptText}
</cr-button>
<cr-button id="cancel" on-click="onDecline_">
$i18n{declineText}
</cr-button>
</div>
</div>
</div>
</div>
</template>
<script src="welcome.js"></script>
</dom-module>
</head>
<body>
<welcome-app></welcome-app>
<div class="watermark"></div>
</body>
</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.
Polymer({
is: 'welcome-app',
/** @private */
onAccept_: function() {
chrome.send('handleActivateSignIn');
},
/** @private */
onDecline_: function() {
chrome.send('handleUserDecline');
},
/** @private */
onLogoTap_: function() {
this.$$('.logo-icon')
.animate(
{
transform: ['none', 'rotate(-10turn)'],
},
/** @type {!KeyframeEffectOptions} */ ({
duration: 500,
easing: 'cubic-bezier(1, 0, 0, 1)',
}));
},
});
......@@ -5,9 +5,7 @@
#include "chrome/browser/ui/webui/welcome/welcome_ui.h"
#include "base/bind.h"
#include "base/metrics/histogram_macros.h"
#include "base/stl_util.h"
#include "build/build_config.h"
#include "base/strings/string_number_conversions.h"
#include "chrome/browser/signin/account_consistency_mode_manager.h"
#include "chrome/browser/ui/webui/localized_string.h"
#include "chrome/browser/ui/webui/welcome/nux/bookmark_handler.h"
......@@ -18,7 +16,6 @@
#include "chrome/browser/ui/webui/welcome/nux_helper.h"
#include "chrome/browser/ui/webui/welcome/welcome_handler.h"
#include "chrome/common/pref_names.h"
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/chrome_unscaled_resources.h"
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
......@@ -27,9 +24,7 @@
#include "components/prefs/pref_service.h"
#include "components/signin/public/base/signin_pref_names.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_contents.h"
#include "net/base/url_util.h"
#include "ui/base/l10n/l10n_util.h"
#if defined(OS_WIN)
#include "base/win/windows_version.h"
......@@ -37,13 +32,6 @@
namespace {
const bool kIsBranded =
#if defined(GOOGLE_CHROME_BUILD)
true;
#else
false;
#endif
const char kPreviewBackgroundPath[] = "preview-background.jpg";
bool ShouldHandleRequestCallback(base::WeakPtr<WelcomeUI> weak_ptr,
......@@ -81,13 +69,11 @@ void HandleRequestCallback(
void AddOnboardingStrings(content::WebUIDataSource* html_source) {
static constexpr LocalizedString kLocalizedStrings[] = {
// Shared strings.
{"acceptText", IDS_WELCOME_ACCEPT_BUTTON},
{"bookmarkAdded", IDS_ONBOARDING_WELCOME_BOOKMARK_ADDED},
{"bookmarksAdded", IDS_ONBOARDING_WELCOME_BOOKMARKS_ADDED},
{"bookmarkRemoved", IDS_ONBOARDING_WELCOME_BOOKMARK_REMOVED},
{"bookmarksRemoved", IDS_ONBOARDING_WELCOME_BOOKMARKS_REMOVED},
{"defaultBrowserChanged", IDS_ONBOARDING_DEFAULT_BROWSER_CHANGED},
{"getStarted", IDS_ONBOARDING_WELCOME_GET_STARTED},
{"headerText", IDS_WELCOME_HEADER},
{"next", IDS_ONBOARDING_WELCOME_NEXT},
{"noThanks", IDS_NO_THANKS},
......@@ -115,7 +101,6 @@ void AddOnboardingStrings(content::WebUIDataSource* html_source) {
{"setDefaultHeader", IDS_ONBOARDING_WELCOME_NUX_SET_AS_DEFAULT_HEADER},
{"setDefaultSubHeader",
IDS_ONBOARDING_WELCOME_NUX_SET_AS_DEFAULT_SUB_HEADER},
{"setDefaultSkip", IDS_ONBOARDING_WELCOME_NUX_SET_AS_DEFAULT_SKIP},
{"setDefaultConfirm",
IDS_ONBOARDING_WELCOME_NUX_SET_AS_DEFAULT_SET_AS_DEFAULT},
......@@ -148,111 +133,81 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url)
content::WebUIDataSource* html_source =
content::WebUIDataSource::Create(url.host());
if (nux::IsNuxOnboardingEnabled(profile)) {
// Add Onboarding welcome strings.
AddOnboardingStrings(html_source);
// Add Onboarding welcome strings.
AddOnboardingStrings(html_source);
// Add all Onboarding resources.
for (size_t i = 0; i < kOnboardingWelcomeResourcesSize; ++i) {
html_source->AddResourcePath(kOnboardingWelcomeResources[i].name,
kOnboardingWelcomeResources[i].value);
}
// Add all Onboarding resources.
for (size_t i = 0; i < kOnboardingWelcomeResourcesSize; ++i) {
html_source->AddResourcePath(kOnboardingWelcomeResources[i].name,
kOnboardingWelcomeResources[i].value);
}
#if defined(GOOGLE_CHROME_BUILD)
// Load unscaled images.
html_source->AddResourcePath("images/module_icons/google_dark.svg",
IDR_WELCOME_MODULE_ICONS_GOOGLE_DARK);
html_source->AddResourcePath("images/module_icons/google_light.svg",
IDR_WELCOME_MODULE_ICONS_GOOGLE_LIGHT);
html_source->AddResourcePath("images/module_icons/set_default_dark.svg",
IDR_WELCOME_MODULE_ICONS_SET_DEFAULT_DARK);
html_source->AddResourcePath("images/module_icons/set_default_light.svg",
IDR_WELCOME_MODULE_ICONS_SET_DEFAULT_LIGHT);
html_source->AddResourcePath("images/module_icons/wallpaper_dark.svg",
IDR_WELCOME_MODULE_ICONS_WALLPAPER_DARK);
html_source->AddResourcePath("images/module_icons/wallpaper_light.svg",
IDR_WELCOME_MODULE_ICONS_WALLPAPER_LIGHT);
html_source->AddResourcePath("images/ntp_thumbnails/art.jpg",
IDR_WELCOME_NTP_THUMBNAILS_ART);
html_source->AddResourcePath("images/ntp_thumbnails/cityscape.jpg",
IDR_WELCOME_NTP_THUMBNAILS_CITYSCAPE);
html_source->AddResourcePath("images/ntp_thumbnails/earth.jpg",
IDR_WELCOME_NTP_THUMBNAILS_EARTH);
html_source->AddResourcePath("images/ntp_thumbnails/geometric_shapes.jpg",
IDR_WELCOME_NTP_THUMBNAILS_GEOMETRIC_SHAPES);
html_source->AddResourcePath("images/ntp_thumbnails/landscape.jpg",
IDR_WELCOME_NTP_THUMBNAILS_LANDSCAPE);
html_source->AddResourcePath("images/set_default_dark.svg",
IDR_WELCOME_SET_DEFAULT_DARK);
html_source->AddResourcePath("images/set_default_light.svg",
IDR_WELCOME_SET_DEFAULT_LIGHT);
// Load unscaled images.
html_source->AddResourcePath("images/module_icons/google_dark.svg",
IDR_WELCOME_MODULE_ICONS_GOOGLE_DARK);
html_source->AddResourcePath("images/module_icons/google_light.svg",
IDR_WELCOME_MODULE_ICONS_GOOGLE_LIGHT);
html_source->AddResourcePath("images/module_icons/set_default_dark.svg",
IDR_WELCOME_MODULE_ICONS_SET_DEFAULT_DARK);
html_source->AddResourcePath("images/module_icons/set_default_light.svg",
IDR_WELCOME_MODULE_ICONS_SET_DEFAULT_LIGHT);
html_source->AddResourcePath("images/module_icons/wallpaper_dark.svg",
IDR_WELCOME_MODULE_ICONS_WALLPAPER_DARK);
html_source->AddResourcePath("images/module_icons/wallpaper_light.svg",
IDR_WELCOME_MODULE_ICONS_WALLPAPER_LIGHT);
html_source->AddResourcePath("images/ntp_thumbnails/art.jpg",
IDR_WELCOME_NTP_THUMBNAILS_ART);
html_source->AddResourcePath("images/ntp_thumbnails/cityscape.jpg",
IDR_WELCOME_NTP_THUMBNAILS_CITYSCAPE);
html_source->AddResourcePath("images/ntp_thumbnails/earth.jpg",
IDR_WELCOME_NTP_THUMBNAILS_EARTH);
html_source->AddResourcePath("images/ntp_thumbnails/geometric_shapes.jpg",
IDR_WELCOME_NTP_THUMBNAILS_GEOMETRIC_SHAPES);
html_source->AddResourcePath("images/ntp_thumbnails/landscape.jpg",
IDR_WELCOME_NTP_THUMBNAILS_LANDSCAPE);
html_source->AddResourcePath("images/set_default_dark.svg",
IDR_WELCOME_SET_DEFAULT_DARK);
html_source->AddResourcePath("images/set_default_light.svg",
IDR_WELCOME_SET_DEFAULT_LIGHT);
#endif // defined(GOOGLE_CHROME_BUILD)
// chrome://welcome
html_source->SetDefaultResource(
IDR_WELCOME_ONBOARDING_WELCOME_WELCOME_HTML);
// chrome://welcome
html_source->SetDefaultResource(IDR_WELCOME_ONBOARDING_WELCOME_WELCOME_HTML);
#if defined(OS_WIN)
html_source->AddBoolean(
"is_win10", base::win::GetVersion() >= base::win::Version::WIN10);
html_source->AddBoolean("is_win10",
base::win::GetVersion() >= base::win::Version::WIN10);
#endif
// Add the shared bookmark handler for onboarding modules.
web_ui->AddMessageHandler(
std::make_unique<nux::BookmarkHandler>(profile->GetPrefs()));
// Add google apps bookmarking onboarding module.
web_ui->AddMessageHandler(std::make_unique<nux::GoogleAppsHandler>());
// Add NTP custom background onboarding module.
web_ui->AddMessageHandler(std::make_unique<nux::NtpBackgroundHandler>());
// Add set-as-default onboarding module.
web_ui->AddMessageHandler(std::make_unique<nux::SetAsDefaultHandler>());
html_source->AddString(
"newUserModules",
nux::GetNuxOnboardingModules(profile).FindKey("new-user")->GetString());
html_source->AddString("returningUserModules",
nux::GetNuxOnboardingModules(profile)
.FindKey("returning-user")
->GetString());
html_source->AddBoolean("signinAllowed", profile->GetPrefs()->GetBoolean(
prefs::kSigninAllowed));
html_source->SetRequestFilter(
base::BindRepeating(&ShouldHandleRequestCallback,
weak_ptr_factory_.GetWeakPtr()),
base::BindRepeating(&HandleRequestCallback,
weak_ptr_factory_.GetWeakPtr()));
html_source->SetJsonPath("strings.js");
} else {
// Use default layout for non-DICE or unbranded build.
std::string value;
bool is_everywhere_variant =
(net::GetValueForKeyInQuery(url, "variant", &value) &&
value == "everywhere");
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("acceptText", IDS_WELCOME_ACCEPT_BUTTON);
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.css", IDR_WELCOME_CSS);
html_source->SetDefaultResource(IDR_WELCOME_HTML);
html_source->AddResourcePath("logo.png", IDR_PRODUCT_LOGO_128);
html_source->AddResourcePath("logo2x.png", IDR_PRODUCT_LOGO_256);
}
// Add the shared bookmark handler for onboarding modules.
web_ui->AddMessageHandler(
std::make_unique<nux::BookmarkHandler>(profile->GetPrefs()));
// Add google apps bookmarking onboarding module.
web_ui->AddMessageHandler(std::make_unique<nux::GoogleAppsHandler>());
// Add NTP custom background onboarding module.
web_ui->AddMessageHandler(std::make_unique<nux::NtpBackgroundHandler>());
// Add set-as-default onboarding module.
web_ui->AddMessageHandler(std::make_unique<nux::SetAsDefaultHandler>());
html_source->AddString(
"newUserModules",
nux::GetNuxOnboardingModules(profile).FindKey("new-user")->GetString());
html_source->AddString("returningUserModules",
nux::GetNuxOnboardingModules(profile)
.FindKey("returning-user")
->GetString());
html_source->AddBoolean(
"signinAllowed", profile->GetPrefs()->GetBoolean(prefs::kSigninAllowed));
html_source->SetRequestFilter(
base::BindRepeating(&ShouldHandleRequestCallback,
weak_ptr_factory_.GetWeakPtr()),
base::BindRepeating(&HandleRequestCallback,
weak_ptr_factory_.GetWeakPtr()));
html_source->SetJsonPath("strings.js");
content::WebUIDataSource::Add(profile, html_source);
}
......
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