0

NUX: Move Google Apps NUX to a more common location.

This is technical debt that will be more expensive if we build out the
email NUX before resolving.

Bug: None
Change-Id: Ibb92872a55bc6089a7fcda6dc52064f4ef87150a
Reviewed-on: https://chromium-review.googlesource.com/1183844
Reviewed-by: Scott Chen <scottchen@chromium.org>
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Hector Carmona <hcarmona@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585326}
This commit is contained in:
Hector Carmona
2018-08-23 00:12:00 +00:00
committed by Commit Bot
parent 29f44eb902
commit 8e6f1aaf7e
35 changed files with 59 additions and 64 deletions

@ -1153,7 +1153,7 @@ if (closure_compile) {
data_deps += [ "components/offline_pages/resources:closure_compile" ]
}
if (is_win && is_chrome_branded) {
data_deps += [ "components/nux_google_apps/resources:closure_compile" ]
data_deps += [ "components/nux/resources:closure_compile" ]
}
}
}

@ -3897,7 +3897,7 @@ jumbo_split_static_library("ui") {
}
if (is_win && is_chrome_branded) {
deps += [ "//components/nux_google_apps:nux_google_apps_feature" ]
deps += [ "//components/nux:google_apps_feature" ]
}
if (enable_plugins) {

@ -28,8 +28,8 @@
#endif // defined(OS_WIN)
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
#include "components/nux_google_apps/constants.h"
#include "components/nux_google_apps/google_apps_handler.h"
#include "components/nux/google_apps/constants.h"
#include "components/nux/google_apps/google_apps_handler.h"
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
namespace {
@ -84,7 +84,7 @@ StartupTabs StartupTabProviderImpl::GetOnboardingTabs(Profile* profile) const {
#if defined(OS_WIN)
#if defined(GOOGLE_CHROME_BUILD)
if (base::FeatureList::IsEnabled(nux_google_apps::kNuxGoogleAppsFeature)) {
if (base::FeatureList::IsEnabled(nux::kNuxGoogleAppsFeature)) {
standard_params.is_apps_promo_allowed = true;
standard_params.has_seen_apps_promo =
prefs && prefs->GetBoolean(prefs::kHasSeenGoogleAppsPromoPage);
@ -214,8 +214,7 @@ StartupTabs StartupTabProviderImpl::GetStandardOnboardingTabsForState(
// 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_google_apps::kNuxGoogleAppsUrl), false)});
return StartupTabs({StartupTab(GURL(nux::kNuxGoogleAppsUrl), false)});
}
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
@ -253,8 +252,7 @@ StartupTabs StartupTabProviderImpl::GetWin10OnboardingTabsForState(
// 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_google_apps::kNuxGoogleAppsUrl), false)});
return StartupTabs({StartupTab(GURL(nux::kNuxGoogleAppsUrl), false)});
}
#endif // defined(GOOGLE_CHROME_BUILD)

@ -15,7 +15,7 @@
#if defined(OS_WIN)
#include "base/win/windows_version.h"
#if defined(GOOGLE_CHROME_BUILD)
#include "components/nux_google_apps/constants.h"
#include "components/nux/google_apps/constants.h"
#endif // defined(GOOGLE_CHROME_BUILD)
#endif // defined(OS_WIN)
@ -334,7 +334,7 @@ TEST(StartupTabProviderTest, GetAppsPromoTabsForState) {
StartupTabProviderImpl::GetStandardOnboardingTabsForState(params);
ASSERT_EQ(1U, output.size());
EXPECT_EQ(nux_google_apps::kNuxGoogleAppsUrl, output[0].url);
EXPECT_EQ(nux::kNuxGoogleAppsUrl, output[0].url);
EXPECT_FALSE(output[0].is_pinned);
}
{
@ -351,7 +351,7 @@ TEST(StartupTabProviderTest, GetAppsPromoTabsForState) {
standard_params, win10_params);
ASSERT_EQ(1U, output.size());
EXPECT_EQ(nux_google_apps::kNuxGoogleAppsUrl, output[0].url);
EXPECT_EQ(nux::kNuxGoogleAppsUrl, output[0].url);
EXPECT_FALSE(output[0].is_pinned);
}
}

@ -25,9 +25,9 @@
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
#include "base/metrics/histogram_macros.h"
#include "chrome/browser/bookmarks/bookmark_model_factory.h"
#include "components/nux/google_apps/constants.h"
#include "components/nux/google_apps/google_apps_handler.h"
#include "components/nux/show_promo_delegate.h"
#include "components/nux_google_apps/constants.h"
#include "components/nux_google_apps/google_apps_handler.h"
#include "content/public/browser/web_contents.h"
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
@ -111,17 +111,16 @@ WelcomeUI::WelcomeUI(content::WebUI* web_ui, const GURL& url)
}
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
if (base::FeatureList::IsEnabled(nux_google_apps::kNuxGoogleAppsFeature)) {
if (base::FeatureList::IsEnabled(nux::kNuxGoogleAppsFeature)) {
content::BrowserContext* browser_context =
web_ui->GetWebContents()->GetBrowserContext();
web_ui->AddMessageHandler(
std::make_unique<nux_google_apps::GoogleAppsHandler>(
profile->GetPrefs(),
FaviconServiceFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
BookmarkModelFactory::GetForBrowserContext(browser_context)));
web_ui->AddMessageHandler(std::make_unique<nux::GoogleAppsHandler>(
profile->GetPrefs(),
FaviconServiceFactory::GetForProfile(
profile, ServiceAccessType::EXPLICIT_ACCESS),
BookmarkModelFactory::GetForBrowserContext(browser_context)));
nux_google_apps::GoogleAppsHandler::AddSources(html_source);
nux::GoogleAppsHandler::AddSources(html_source);
}
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD
@ -132,15 +131,14 @@ WelcomeUI::~WelcomeUI() {}
void WelcomeUI::StorePageSeen(Profile* profile, const GURL& url) {
#if defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)
if (url.EqualsIgnoringRef(GURL(nux_google_apps::kNuxGoogleAppsUrl))) {
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_google_apps::kGoogleAppsInteractionHistogram,
nux_google_apps::GoogleAppsInteraction::kPromptShown,
nux_google_apps::GoogleAppsInteraction::kCount);
UMA_HISTOGRAM_ENUMERATION(nux::kGoogleAppsInteractionHistogram,
nux::GoogleAppsInteraction::kPromptShown,
nux::GoogleAppsInteraction::kCount);
return;
}
#endif // defined(OS_WIN) && defined(GOOGLE_CHROME_BUILD)

@ -29,7 +29,7 @@ include_rules = [
"+components/net_log",
"+components/network_session_configurator/common",
"+components/ntp_tiles",
"+components/nux_google_apps",
"+components/nux",
"+components/offline_pages/buildflags",
"+components/password_manager/core/common",
"+components/policy/core/common",

@ -13,7 +13,7 @@ per-file crash_strings.grdp=file://components/crash/OWNERS
per-file dom_distiller_strings.grdp=file://components/dom_distiller/OWNERS
per-file error_page_strings.grdp=file://components/error_page/OWNERS
per-file ntp_snippets_strings.grdp=file://components/ntp_snippets/OWNERS
per-file nux_google_apps_strings.grdp=file://components/nux_google_apps/OWNERS
per-file nux_google_apps_strings.grdp=file://components/nux/OWNERS
per-file omnibox_strings.grdp=file://components/omnibox/OWNERS
per-file page_info_strings.grdp=file://chrome/browser/ui/page_info/OWNERS
per-file page_info_strings_grdp=file://chrome/browser/ui/page_info/OWNERS

@ -5,12 +5,12 @@
import("//build/config/chrome_build.gni")
if (is_win && is_chrome_branded) {
static_library("nux_google_apps_feature") {
static_library("google_apps_feature") {
sources = [
"constants.cc",
"constants.h",
"google_apps_handler.cc",
"google_apps_handler.h",
"google_apps/constants.cc",
"google_apps/constants.h",
"google_apps/google_apps_handler.cc",
"google_apps/google_apps_handler.h",
]
public_deps = [

@ -2,15 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/nux_google_apps/constants.h"
#include "components/nux/google_apps/constants.h"
#include "base/feature_list.h"
namespace nux_google_apps {
namespace nux {
extern const base::Feature kNuxGoogleAppsFeature{
"NuxGoogleApps", base::FEATURE_DISABLED_BY_DEFAULT};
extern const char kNuxGoogleAppsUrl[] = "chrome://welcome/apps";
} // namespace nux_google_apps
} // namespace nux

@ -9,11 +9,11 @@ namespace base {
struct Feature;
} // namespace base
namespace nux_google_apps {
namespace nux {
extern const base::Feature kNuxGoogleAppsFeature;
extern const char kNuxGoogleAppsUrl[];
} // namespace nux_google_apps
} // namespace nux
#endif // COMPONENTS_NUX_GOOGLE_APPS_CONSTANTS_H_

@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/nux_google_apps/google_apps_handler.h"
#include "components/nux/google_apps/google_apps_handler.h"
#include "base/bind.h"
#include "base/metrics/field_trial_params.h"
@ -14,8 +14,8 @@
#include "components/favicon/core/favicon_service.h"
#include "components/grit/components_resources.h"
#include "components/grit/components_scaled_resources.h"
#include "components/nux/google_apps/constants.h"
#include "components/nux/show_promo_delegate.h"
#include "components/nux_google_apps/constants.h"
#include "components/prefs/pref_service.h"
#include "components/strings/grit/components_strings.h"
#include "content/public/browser/web_contents.h"
@ -23,7 +23,7 @@
#include "content/public/browser/web_ui_data_source.h"
#include "ui/base/resource/resource_bundle.h"
namespace nux_google_apps {
namespace nux {
// These values are persisted to logs. Entries should not be renumbered and
// numeric values should never be reused.
@ -182,4 +182,4 @@ void GoogleAppsHandler::AddSources(content::WebUIDataSource* html_source) {
IDR_NUX_GOOGLE_APPS_YOUTUBE_2X);
}
} // namespace nux_google_apps
} // namespace nux

@ -23,7 +23,7 @@ namespace favicon {
class FaviconService;
} // namespace favicon
namespace nux_google_apps {
namespace nux {
extern const char* kGoogleAppsInteractionHistogram;
@ -66,6 +66,6 @@ class GoogleAppsHandler : public content::WebUIMessageHandler {
DISALLOW_COPY_AND_ASSIGN(GoogleAppsHandler);
};
} // namespace nux_google_apps
} // namespace nux
#endif // COMPONENTS_NUX_GOOGLE_APPS_GOOGLE_APPS_HANDLER_H_

@ -1 +0,0 @@
hcarmona@chromium.org

@ -1,21 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<grit-part>
<include name="IDR_NUX_GOOGLE_APPS_HTML" file="../nux_google_apps/resources/nux_google_apps.html" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_JS" file="../nux_google_apps/resources/nux_google_apps.js" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_PROXY_HTML" file="../nux_google_apps/resources/nux_google_apps_proxy.html" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_PROXY_JS" file="../nux_google_apps/resources/nux_google_apps_proxy.js" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_CHOOSER_HTML" file="../nux_google_apps/resources/apps_chooser.html" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_CHOOSER_JS" file="../nux_google_apps/resources/apps_chooser.js" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_CHROME_STORE_1X" file="../nux_google_apps/resources/chrome_store_24dp_1x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_CHROME_STORE_2X" file="../nux_google_apps/resources/chrome_store_24dp_2x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_GMAIL_1X" file="../nux_google_apps/resources/gmail_24dp_1x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_GMAIL_2X" file="../nux_google_apps/resources/gmail_24dp_2x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_MAPS_1X" file="../nux_google_apps/resources/maps_24dp_1x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_MAPS_2X" file="../nux_google_apps/resources/maps_24dp_2x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_NEWS_1X" file="../nux_google_apps/resources/news_24dp_1x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_NEWS_2X" file="../nux_google_apps/resources/news_24dp_2x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_TRANSLATE_1X" file="../nux_google_apps/resources/translate_24dp_1x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_TRANSLATE_2X" file="../nux_google_apps/resources/translate_24dp_2x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_YOUTUBE_1X" file="../nux_google_apps/resources/youtube_24dp_1x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_YOUTUBE_2X" file="../nux_google_apps/resources/youtube_24dp_2x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_HTML" file="../nux/google_apps/resources/nux_google_apps.html" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_JS" file="../nux/google_apps/resources/nux_google_apps.js" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_PROXY_HTML" file="../nux/google_apps/resources/nux_google_apps_proxy.html" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_PROXY_JS" file="../nux/google_apps/resources/nux_google_apps_proxy.js" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_CHOOSER_HTML" file="../nux/google_apps/resources/apps_chooser.html" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_CHOOSER_JS" file="../nux/google_apps/resources/apps_chooser.js" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_CHROME_STORE_1X" file="../nux/google_apps/resources/chrome_store_24dp_1x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_CHROME_STORE_2X" file="../nux/google_apps/resources/chrome_store_24dp_2x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_GMAIL_1X" file="../nux/google_apps/resources/gmail_24dp_1x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_GMAIL_2X" file="../nux/google_apps/resources/gmail_24dp_2x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_MAPS_1X" file="../nux/google_apps/resources/maps_24dp_1x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_MAPS_2X" file="../nux/google_apps/resources/maps_24dp_2x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_NEWS_1X" file="../nux/google_apps/resources/news_24dp_1x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_NEWS_2X" file="../nux/google_apps/resources/news_24dp_2x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_TRANSLATE_1X" file="../nux/google_apps/resources/translate_24dp_1x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_TRANSLATE_2X" file="../nux/google_apps/resources/translate_24dp_2x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_YOUTUBE_1X" file="../nux/google_apps/resources/youtube_24dp_1x.png" type="BINDATA" />
<include name="IDR_NUX_GOOGLE_APPS_YOUTUBE_2X" file="../nux/google_apps/resources/youtube_24dp_2x.png" type="BINDATA" />
</grit-part>