Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: chrome/browser/ui/webui/ntp/ntp_resource_cache.cc

Issue 11953021: Don't show the apps page on the NTP if the app launcher is installed. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make shouldShowApps a pref Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
diff --git a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
index cd6dbb789865fb8db979c135d333752b86daf837..8b0d00f0da75b9c0e81fccd77e2e9ca15a7d0520 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -192,6 +192,12 @@ bool NTPResourceCache::NewTabCacheNeedsRefresh() {
return true;
}
#endif
+ bool should_show_apps_page = profile_->GetPrefs()->GetBoolean(
+ prefs::kNtpShouldShowAppsPage);
+ if (should_show_apps_page != should_show_apps_page_) {
+ should_show_apps_page_ = should_show_apps_page;
+ return true;
+ }
return false;
}
@@ -312,6 +318,8 @@ void NTPResourceCache::CreateNewTabHTML() {
DictionaryValue load_time_data;
load_time_data.SetBoolean("bookmarkbarattached",
prefs->GetBoolean(prefs::kShowBookmarkBar));
+ load_time_data.SetBoolean("showApps",
+ prefs->GetBoolean(prefs::kNtpShouldShowAppsPage));
load_time_data.SetBoolean("hasattribution",
ThemeServiceFactory::GetForProfile(profile_)->HasCustomImage(
IDR_THEME_NTP_ATTRIBUTION));
@@ -379,7 +387,6 @@ void NTPResourceCache::CreateNewTabHTML() {
l10n_util::GetStringUTF16(IDS_NEW_TAB_APP_INSTALL_HINT_LABEL));
load_time_data.SetBoolean("isDiscoveryInNTPEnabled",
NewTabUI::IsDiscoveryInNTPEnabled());
- load_time_data.SetBoolean("showApps", NewTabUI::ShouldShowApps());
load_time_data.SetString("collapseSessionMenuItemText",
l10n_util::GetStringUTF16(IDS_NEW_TAB_OTHER_SESSIONS_COLLAPSE_SESSION));
load_time_data.SetString("expandSessionMenuItemText",

Powered by Google App Engine
This is Rietveld 408576698