Commit f05b75d0 authored by Greg Thompson's avatar Greg Thompson Committed by Commit Bot

Revert "NUX Onboarding: clean up build process."

This reverts commit 4ad50af3.

Reason for revert: Breaks is_chrome_branded builds -- startup_tab_provider_unittest.cc is still referencing members of StandardOnboardingTabsParams that were removed.

Original change's description:
> NUX Onboarding: clean up build process.
> 
> This CL cleans up the remnants of the NUX Experiments bulid configs. Including:
> - removing os_win and google_chrome_branded build flag.
> - removing prefs that tracks if the one-off NUX experiments were seen.
> - fixing closure compile errors now that it needs to build on non-official bots.
> 
> Bug: 874153
> Change-Id: I03c1ed09c54f5ba91944bcb31837e80a0ee1fc74
> Reviewed-on: https://chromium-review.googlesource.com/c/1252906
> Commit-Queue: Scott Chen <scottchen@chromium.org>
> Reviewed-by: Scott Violet <sky@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#596432}

TBR=sky@chromium.org,scottchen@chromium.org

Change-Id: I643cfa84bb9da07b4e1ebf8a9481d0ac32aeea90
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 874153
Reviewed-on: https://chromium-review.googlesource.com/c/1260128Reviewed-by: default avatarGreg Thompson <grt@chromium.org>
Commit-Queue: Greg Thompson <grt@chromium.org>
Cr-Commit-Position: refs/heads/master@{#596535}
parent b0a5a498
......@@ -1167,6 +1167,10 @@ if (closure_compile) {
if (is_android) {
data_deps += [ "components/offline_pages/resources:closure_compile" ]
}
if (is_win && is_chrome_branded) {
# TODO(scottchen): uncomment after fixing closure compile deps for NUX.
# data_deps += [ "components/nux/resources:closure_compile" ]
}
}
}
......
......@@ -1092,6 +1092,9 @@ void ProfileManager::InitProfileUserPrefs(Profile* profile) {
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
// Enterprise users should not be included in any NUX flow.
if (!base::win::IsEnterpriseManaged()) {
profile->GetPrefs()->SetBoolean(prefs::kHasSeenGoogleAppsPromoPage,
false);
profile->GetPrefs()->SetBoolean(prefs::kHasSeenEmailPromoPage, false);
profile->GetPrefs()->SetBoolean(prefs::kOnboardDuringNUX, true);
}
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
......
......@@ -27,7 +27,6 @@ if (closure_compile) {
"print_preview:closure_compile",
"settings:closure_compile",
"signin/dice_sync_confirmation:closure_compile",
"welcome/onboarding_welcome:closure_compile",
]
}
if (is_chromeos) {
......
# 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.
import("//third_party/closure_compiler/compile_js.gni")
group("closure_compile") {
deps = [
":welcome_files",
"./email:closure_compile",
"./google_apps:closure_compile",
"./set_as_default:closure_compile",
]
}
js_type_check("welcome_files") {
deps = [
":landing_view",
":welcome_app",
]
}
js_library("landing_view") {
deps = [
":navigation_behavior",
":welcome_browser_proxy",
]
}
js_library("navigation_behavior") {
deps = [
"//ui/webui/resources/js:cr",
]
}
js_library("welcome_app") {
deps = [
":navigation_behavior",
":welcome_browser_proxy",
"//ui/webui/resources/cr_elements/cr_view_manager:cr_view_manager",
]
}
js_library("welcome_browser_proxy") {
deps = [
"//ui/webui/resources/js:cr",
]
externs_list = [ "$externs_path/chrome_send.js" ]
}
......@@ -6,7 +6,6 @@ import("//third_party/closure_compiler/compile_js.gni")
js_type_check("closure_compile") {
deps = [
":email_chooser",
":nux_email",
]
}
......@@ -14,22 +13,3 @@ js_type_check("closure_compile") {
js_library("nux_email") {
deps = []
}
js_library("email_chooser") {
deps = [
":nux_email_proxy",
"//third_party/polymer/v1_0/components-chromium/iron-a11y-announcer:iron-a11y-announcer-extracted",
"//ui/webui/resources/js:i18n_behavior",
]
}
js_library("nux_email_proxy") {
deps = [
"//ui/webui/resources/js:cr",
]
externs_list = [
"$externs_path/chrome_extensions.js",
"$externs_path/chrome_send.js",
"$externs_path/metrics_private.js",
]
}
......@@ -23,8 +23,5 @@ js_library("nux_google_apps") {
}
js_library("nux_google_apps_proxy") {
deps = [
"//ui/webui/resources/js:cr",
]
externs_list = [ "$externs_path/chrome_send.js" ]
deps = []
}
......@@ -13,13 +13,9 @@ js_type_check("closure_compile") {
js_library("nux_set_as_default") {
deps = [
":nux_set_as_default_proxy",
"//ui/webui/resources/js:web_ui_listener_behavior",
]
}
js_library("nux_set_as_default_proxy") {
deps = [
"//ui/webui/resources/js:cr",
]
externs_list = [ "$externs_path/chrome_send.js" ]
deps = []
}
......@@ -1956,11 +1956,15 @@ jumbo_split_static_library("ui") {
"webui/welcome/welcome_ui.h",
]
deps += [
"//chrome/browser/ui/webui/welcome/nux:constants",
"//chrome/browser/ui/webui/welcome/nux:email_feature",
"//chrome/browser/ui/webui/welcome/nux:google_apps_feature",
]
# TODO(scottchen): Remove if-check once nux files are non-exclusive
# to windows.
if (is_win && is_chrome_branded) {
deps += [
"//chrome/browser/ui/webui/welcome/nux:constants",
"//chrome/browser/ui/webui/welcome/nux:email_feature",
"//chrome/browser/ui/webui/welcome/nux:google_apps_feature",
]
}
if (enable_dice_support) {
sources += [
......
......@@ -463,6 +463,12 @@ void StartupBrowserCreator::RegisterProfilePrefs(PrefRegistrySimple* registry) {
// creation.
registry->RegisterBooleanPref(prefs::kHasSeenWelcomePage, true);
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
// TODO(scottchen): To make this testable early by trybots, instead of hiding
// behind GOOGLE_CHROME_BUILD, use a function that returns true for official
// builds and conditionally returns true based on a command line switch to
// be set by tests.
registry->RegisterBooleanPref(prefs::kHasSeenGoogleAppsPromoPage, true);
registry->RegisterBooleanPref(prefs::kHasSeenEmailPromoPage, true);
// This will be set to true for newly created profiles, and is used to
// indicate which users went through FRE after NUX is enabled.
registry->RegisterBooleanPref(prefs::kOnboardDuringNUX, false);
......
......@@ -59,6 +59,11 @@ bool ProfileHasOtherTabbedBrowser(Profile* profile) {
} // namespace
StartupTabProviderImpl::StandardOnboardingTabsParams::
StandardOnboardingTabsParams() = default;
StartupTabProviderImpl::StandardOnboardingTabsParams::
~StandardOnboardingTabsParams() = default;
StartupTabs StartupTabProviderImpl::GetOnboardingTabs(Profile* profile) const {
// Onboarding content has not been launched on Chrome OS.
#if defined(OS_CHROMEOS)
......@@ -81,9 +86,29 @@ StartupTabs StartupTabProviderImpl::GetOnboardingTabs(Profile* profile) const {
standard_params.is_supervised_user = profile->IsSupervised();
standard_params.is_force_signin_enabled = signin_util::IsForceSigninEnabled();
// TODO(scottchen): make win-10 also show NUX onboarding page when its enabled.
#if defined(OS_WIN)
#if defined(GOOGLE_CHROME_BUILD)
// To avoid diluting data collection, existing users should not be assigned
// an NUX group. So, the kOnboardDuringNUX flag is used to short-circuit the
// feature checks below.
bool onboard_during_nux =
prefs && prefs->GetBoolean(prefs::kOnboardDuringNUX);
if (onboard_during_nux &&
base::FeatureList::IsEnabled(nux::kNuxGoogleAppsFeature)) {
standard_params.is_apps_promo_allowed = true;
standard_params.has_seen_apps_promo =
prefs && prefs->GetBoolean(prefs::kHasSeenGoogleAppsPromoPage);
}
if (onboard_during_nux &&
base::FeatureList::IsEnabled(nux::kNuxEmailFeature)) {
standard_params.is_email_promo_allowed = true;
standard_params.has_seen_email_promo =
prefs && prefs->GetBoolean(prefs::kHasSeenEmailPromoPage);
}
#endif // defined(GOOGLE_CHROME_BUILD)
// Windows 10 has unique onboarding policies and content.
if (base::win::GetVersion() >= base::win::VERSION_WIN10) {
Win10OnboardingTabsParams win10_params;
......@@ -203,6 +228,19 @@ bool StartupTabProviderImpl::ShouldShowWelcomeForOnboarding(
// static
StartupTabs StartupTabProviderImpl::GetStandardOnboardingTabsForState(
const StandardOnboardingTabsParams& params) {
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
// Should be shown before any other new user experience.
if (ShouldShowNewUserExperience(params.is_apps_promo_allowed,
params.has_seen_apps_promo)) {
return StartupTabs({StartupTab(GURL(nux::kNuxGoogleAppsUrl), false)});
}
if (ShouldShowNewUserExperience(params.is_email_promo_allowed,
params.has_seen_email_promo)) {
return StartupTabs({StartupTab(GURL(nux::kNuxEmailUrl), false)});
}
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
StartupTabs tabs;
if (CanShowWelcome(params.is_signin_allowed, params.is_supervised_user,
params.is_force_signin_enabled) &&
......@@ -233,6 +271,19 @@ bool StartupTabProviderImpl::ShouldShowWin10WelcomeForOnboarding(
StartupTabs StartupTabProviderImpl::GetWin10OnboardingTabsForState(
const StandardOnboardingTabsParams& standard_params,
const Win10OnboardingTabsParams& win10_params) {
#if defined(GOOGLE_CHROME_BUILD)
// Should be shown before any other new user experience.
if (ShouldShowNewUserExperience(standard_params.is_apps_promo_allowed,
standard_params.has_seen_apps_promo)) {
return StartupTabs({StartupTab(GURL(nux::kNuxGoogleAppsUrl), false)});
}
if (ShouldShowNewUserExperience(standard_params.is_email_promo_allowed,
standard_params.has_seen_email_promo)) {
return StartupTabs({StartupTab(GURL(nux::kNuxEmailUrl), false)});
}
#endif // defined(GOOGLE_CHROME_BUILD)
if (CanShowWin10Welcome(win10_params.set_default_browser_allowed,
standard_params.is_supervised_user) &&
ShouldShowWin10WelcomeForOnboarding(win10_params.has_seen_win10_promo,
......@@ -243,6 +294,14 @@ StartupTabs StartupTabProviderImpl::GetWin10OnboardingTabsForState(
return GetStandardOnboardingTabsForState(standard_params);
}
#if defined(GOOGLE_CHROME_BUILD)
// static
bool StartupTabProviderImpl::ShouldShowNewUserExperience(bool is_promo_allowed,
bool has_seen_promo) {
return is_promo_allowed && !has_seen_promo;
}
#endif // defined(GOOGLE_CHROME_BUILD)
#endif // defined(OS_WIN)
// static
......
......@@ -65,6 +65,9 @@ class StartupTabProvider {
class StartupTabProviderImpl : public StartupTabProvider {
public:
struct StandardOnboardingTabsParams {
StandardOnboardingTabsParams();
~StandardOnboardingTabsParams();
bool is_first_run = false;
bool has_seen_welcome_page = false;
bool is_signin_allowed = false;
......@@ -72,6 +75,12 @@ class StartupTabProviderImpl : public StartupTabProvider {
bool is_signin_in_progress = false;
bool is_supervised_user = false;
bool is_force_signin_enabled = false;
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
bool has_seen_apps_promo = false;
bool is_apps_promo_allowed = false;
bool has_seen_email_promo = false;
bool is_email_promo_allowed = false;
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
};
struct Win10OnboardingTabsParams {
......@@ -118,6 +127,13 @@ class StartupTabProviderImpl : public StartupTabProvider {
static StartupTabs GetWin10OnboardingTabsForState(
const StandardOnboardingTabsParams& standard_params,
const Win10OnboardingTabsParams& win10_params);
#if defined(GOOGLE_CHROME_BUILD)
// Returns true if showing one of the new user experience experiments is
// permissible.
static bool ShouldShowNewUserExperience(bool is_promo_allowed,
bool has_seen_promo);
#endif // defined(GOOGLE_CHROME_BUILD)
#endif // defined(OS_WIN)
// Processes first run URLs specified in Master Preferences file, replacing
......
......@@ -9,6 +9,7 @@
#include "base/metrics/histogram_macros.h"
#include "base/stl_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/ui/webui/welcome/nux/show_promo_delegate.h"
#include "chrome/grit/browser_resources.h"
#include "chrome/grit/generated_resources.h"
#include "components/bookmarks/browser/bookmark_model.h"
......@@ -123,6 +124,11 @@ void GoogleAppsHandler::HandleAddGoogleApps(const base::ListValue* args) {
// Enable bookmark bar.
prefs_->SetBoolean(bookmarks::prefs::kShowBookmarkBar, true);
// Show bookmark bubble.
ShowPromoDelegate::CreatePromoDelegate(
IDS_NUX_GOOGLE_APPS_DESCRIPTION_PROMO_BUBBLE)
->ShowForNode(bookmark_model_->bookmark_bar_node()->GetChild(0));
UMA_HISTOGRAM_ENUMERATION(kGoogleAppsInteractionHistogram,
GoogleAppsInteraction::kGetStarted,
GoogleAppsInteraction::kCount);
......
......@@ -5,9 +5,13 @@
#include "chrome/browser/ui/webui/welcome/nux_helper.h"
#include "base/feature_list.h"
#include "build/build_config.h"
// TODO(scottchen): remove #if guard once components/nux/ is moved to
// chrome/browser/ui/webui/welcome/ and included by non-win platforms.
// Also check if it makes sense to merge nux_helper.* with nux/constants.*.
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
#include "chrome/browser/ui/webui/welcome/nux/constants.h"
#include "chrome/common/pref_names.h"
#include "components/prefs/pref_service.h"
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
namespace nux {
// This feature flag is used to force the feature to be turned on for non-win
......@@ -15,20 +19,12 @@ namespace nux {
extern const base::Feature kNuxOnboardingForceEnabled{
"NuxOnboardingForceEnabled", base::FEATURE_DISABLED_BY_DEFAULT};
bool IsNuxOnboardingEnabled(Profile* profile) {
bool IsNuxOnboardingEnabled() {
if (base::FeatureList::IsEnabled(nux::kNuxOnboardingForceEnabled)) {
return true;
} else {
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
// To avoid diluting data collection, existing users should not be assigned
// an NUX group. So, the kOnboardDuringNUX flag is used to short-circuit the
// feature checks below.
PrefService* prefs = profile->GetPrefs();
bool onboard_during_nux =
prefs && prefs->GetBoolean(prefs::kOnboardDuringNUX);
return onboard_during_nux &&
base::FeatureList::IsEnabled(nux::kNuxOnboardingFeature);
return base::FeatureList::IsEnabled(nux::kNuxOnboardingFeature);
#else
return false;
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
......
......@@ -6,12 +6,9 @@
#define CHROME_BROWSER_UI_WEBUI_WELCOME_NUX_HELPER_H_
#include "base/macros.h"
#include "chrome/browser/profiles/profile.h"
class Profile;
namespace nux {
bool IsNuxOnboardingEnabled(Profile* profile);
} // namespace nux
bool IsNuxOnboardingEnabled();
}; // namespace nux
#endif // CHROME_BROWSER_UI_WEBUI_WELCOME_NUX_HELPER_H_
......@@ -7,16 +7,9 @@
#include <memory>
#include <string>
#include "base/metrics/histogram_macros.h"
#include "build/build_config.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/favicon/favicon_service_factory.h"
#include "chrome/browser/signin/account_consistency_mode_manager.h"
#include "chrome/browser/ui/webui/welcome/nux/constants.h"
#include "chrome/browser/ui/webui/welcome/nux/email_handler.h"
#include "chrome/browser/ui/webui/welcome/nux/google_apps_handler.h"
#include "chrome/browser/ui/webui/welcome/nux/set_as_default_handler.h"
#include "chrome/browser/ui/webui/welcome/nux/show_promo_delegate.h"
#include "chrome/browser/ui/webui/welcome/nux_helper.h"
#include "chrome/browser/ui/webui/welcome/welcome_handler.h"
#include "chrome/common/pref_names.h"
......@@ -25,11 +18,21 @@
#include "chrome/grit/chromium_strings.h"
#include "chrome/grit/generated_resources.h"
#include "components/prefs/pref_service.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_ui_data_source.h"
#include "net/base/url_util.h"
#include "ui/base/l10n/l10n_util.h"
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
#include "base/metrics/histogram_macros.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "chrome/browser/ui/webui/welcome/nux/constants.h"
#include "chrome/browser/ui/webui/welcome/nux/email_handler.h"
#include "chrome/browser/ui/webui/welcome/nux/google_apps_handler.h"
#include "chrome/browser/ui/webui/welcome/nux/set_as_default_handler.h"
#include "chrome/browser/ui/webui/welcome/nux/show_promo_delegate.h"
#include "content/public/browser/web_contents.h"
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
namespace {
const bool kIsBranded =
#if defined(GOOGLE_CHROME_BUILD)
......@@ -50,7 +53,7 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url)
return;
}
StorePageSeen(profile);
StorePageSeen(profile, url);
web_ui->AddMessageHandler(std::make_unique<WelcomeHandler>(web_ui));
......@@ -65,7 +68,7 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url)
html_source->AddResourcePath("logo.png", IDR_PRODUCT_LOGO_128);
html_source->AddResourcePath("logo2x.png", IDR_PRODUCT_LOGO_256);
if (nux::IsNuxOnboardingEnabled(profile)) {
if (nux::IsNuxOnboardingEnabled()) {
// Add Onboarding welcome strings.
html_source->AddLocalizedString("headerText", IDS_WELCOME_HEADER);
html_source->AddLocalizedString("acceptText", IDS_WELCOME_ACCEPT_BUTTON);
......@@ -95,30 +98,6 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url)
html_source->AddResourcePath(
"welcome_browser_proxy.js",
IDR_WELCOME_ONBOARDING_WELCOME_WELCOME_BROWSER_PROXY_JS);
// Add resources shared by the NUX modules.
html_source->AddResourcePath("shared/chooser_shared_css.html",
IDR_NUX_CHOOSER_SHARED_CSS);
// Add email provider bookmarking onboarding module.
web_ui->AddMessageHandler(std::make_unique<nux::EmailHandler>(
profile->GetPrefs(), FaviconServiceFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS)));
nux::EmailHandler::AddSources(html_source, profile->GetPrefs());
// Add google apps bookmarking onboarding module.
content::BrowserContext* browser_context =
web_ui->GetWebContents()->GetBrowserContext();
web_ui->AddMessageHandler(std::make_unique<nux::GoogleAppsHandler>(
profile->GetPrefs(),
FaviconServiceFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
BookmarkModelFactory::GetForBrowserContext(browser_context)));
nux::GoogleAppsHandler::AddSources(html_source);
// Add set-as-default onboarding module.
web_ui->AddMessageHandler(std::make_unique<nux::SetAsDefaultHandler>());
nux::SetAsDefaultHandler::AddSources(html_source);
} else if (kIsBranded && is_dice) {
// Use special layout if the application is branded and DICE is enabled.
html_source->AddLocalizedString("headerText", IDS_WELCOME_HEADER);
......@@ -164,12 +143,78 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url)
html_source->SetDefaultResource(IDR_WELCOME_HTML);
}
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
// TODO(hcarmona): Move this behind nux::kNuxOnboardingFeature when email and
// apps experiments end.
html_source->AddResourcePath("shared/chooser_shared_css.html",
IDR_NUX_CHOOSER_SHARED_CSS);
if (base::FeatureList::IsEnabled(nux::kNuxOnboardingFeature)) {
web_ui->AddMessageHandler(std::make_unique<nux::SetAsDefaultHandler>());
nux::SetAsDefaultHandler::AddSources(html_source);
// TODO(scottchen): move all NUX features under this flag once individual
// experiments launch.
}
// To avoid diluting data collection, existing users should not be assigned
// an NUX group. So, the kOnboardDuringNUX flag is used to short-circuit the
// feature checks below.
PrefService* prefs = profile->GetPrefs();
bool onboard_during_nux =
prefs && prefs->GetBoolean(prefs::kOnboardDuringNUX);
if (onboard_during_nux &&
base::FeatureList::IsEnabled(nux::kNuxEmailFeature)) {
web_ui->AddMessageHandler(std::make_unique<nux::EmailHandler>(
profile->GetPrefs(), FaviconServiceFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS)));
nux::EmailHandler::AddSources(html_source, profile->GetPrefs());
}
if (onboard_during_nux &&
base::FeatureList::IsEnabled(nux::kNuxGoogleAppsFeature)) {
content::BrowserContext* browser_context =
web_ui->GetWebContents()->GetBrowserContext();
web_ui->AddMessageHandler(std::make_unique<nux::GoogleAppsHandler>(
profile->GetPrefs(),
FaviconServiceFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
BookmarkModelFactory::GetForBrowserContext(browser_context)));
nux::GoogleAppsHandler::AddSources(html_source);
}
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD
content::WebUIDataSource::Add(profile, html_source);
}
WelcomeUI::~WelcomeUI() {}
void WelcomeUI::StorePageSeen(Profile* profile) {
void WelcomeUI::StorePageSeen(Profile* profile, const GURL& url) {
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
if (url.EqualsIgnoringRef(GURL(nux::kNuxGoogleAppsUrl))) {
// Record that the new user experience page was visited.
profile->GetPrefs()->SetBoolean(prefs::kHasSeenGoogleAppsPromoPage, true);
// Record UMA.
UMA_HISTOGRAM_ENUMERATION(nux::kGoogleAppsInteractionHistogram,
nux::GoogleAppsInteraction::kPromptShown,
nux::GoogleAppsInteraction::kCount);
return;
}
if (url.EqualsIgnoringRef(GURL(nux::kNuxEmailUrl))) {
// Record that the new user experience page was visited.
profile->GetPrefs()->SetBoolean(prefs::kHasSeenEmailPromoPage, true);
// TODO(scottchen): Record UMA.
return;
}
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
// Store that this profile has been shown the Welcome page.
profile->GetPrefs()->SetBoolean(prefs::kHasSeenWelcomePage, true);
}
......@@ -19,9 +19,7 @@ class WelcomeUI : public content::WebUIController {
~WelcomeUI() override;
private:
void StorePageSeen(Profile* profile);
DISALLOW_COPY_AND_ASSIGN(WelcomeUI);
void StorePageSeen(Profile* profile, const GURL& url);
};
#endif // CHROME_BROWSER_UI_WEBUI_WELCOME_WELCOME_UI_H_
......@@ -1269,6 +1269,13 @@ const char kHasSeenWelcomePage[] = "browser.has_seen_welcome_page";
const char kHasSeenWin10PromoPage[] = "browser.has_seen_win10_promo_page";
#if defined(GOOGLE_CHROME_BUILD)
// Whether or not this profile has been shown the new user experience promo
// page for google apps.
const char kHasSeenGoogleAppsPromoPage[] =
"browser.has_seen_google_apps_promo_page";
// Whether or not this profile has been shown the new user experience promo
// page for adding email provider to bookmark.
const char kHasSeenEmailPromoPage[] = "browser.has_seen_email_promo_page";
// Whether or not this user went through the first-run experience after NUX
// launched. This is necessary for determining which users to keep "tagging"
// with the NUX finch experiment group, and allows a more accurate analysis.
......
......@@ -438,6 +438,8 @@ extern const char kHasSeenWelcomePage[];
#if defined(OS_WIN)
extern const char kHasSeenWin10PromoPage[];
#if defined(GOOGLE_CHROME_BUILD)
extern const char kHasSeenGoogleAppsPromoPage[];
extern const char kHasSeenEmailPromoPage[];
extern const char kOnboardDuringNUX[];
#endif // defined(GOOGLE_CHROME_BUILD)
#endif // defined(OS_WIN)
......
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