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

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: comments 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..4b5d7124bd8c2d93927dce6796f24689f0135b3e 100644
--- a/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
+++ b/chrome/browser/ui/webui/ntp/ntp_resource_cache.cc
@@ -16,6 +16,7 @@
#include "base/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/browser/browser_process.h"
+#include "chrome/browser/extensions/app_launcher.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/google/google_util.h"
#include "chrome/browser/policy/browser_policy_connector.h"
@@ -192,6 +193,11 @@ bool NTPResourceCache::NewTabCacheNeedsRefresh() {
return true;
}
#endif
+ bool should_show_apps_page = !extensions::IsAppLauncherEnabled();
+ if (should_show_apps_page != should_show_apps_page_) {
+ should_show_apps_page_ = should_show_apps_page;
+ return true;
+ }
return false;
}
@@ -379,7 +385,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",
@@ -399,6 +404,7 @@ void NTPResourceCache::CreateNewTabHTML() {
// feature is enabled.
load_time_data.SetBoolean("isSwipeTrackingFromScrollEventsEnabled",
is_swipe_tracking_from_scroll_events_enabled_);
+ load_time_data.SetBoolean("showApps", should_show_apps_page_);
#if defined(OS_CHROMEOS)
load_time_data.SetString("expandMenu",

Powered by Google App Engine
This is Rietveld 408576698