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

Unified Diff: chrome/browser/ui/webui/ntp/new_tab_ui.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/new_tab_ui.cc
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
index 7986baaa4390d24dbf46a8ab0865383931da49b2..6923fcc74d561aa4a2cf7ef545f2be451171da4f 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -19,6 +19,7 @@
#include "base/threading/thread.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/defaults.h"
+#include "chrome/browser/extensions/app_launcher.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/sessions/session_types.h"
@@ -118,13 +119,11 @@ NewTabUI::NewTabUI(content::WebUI* web_ui)
web_ui->AddMessageHandler(new NewTabPageSyncHandler());
// Or apps.
- if (ShouldShowApps()) {
Evan Stade 2013/01/25 00:11:02 revert this
jeremya 2013/01/25 00:20:42 Done.
- ExtensionService* service = GetProfile()->GetExtensionService();
- // We might not have an ExtensionService (on ChromeOS when not logged in
- // for example).
- if (service)
- web_ui->AddMessageHandler(new AppLauncherHandler(service));
- }
+ ExtensionService* service = GetProfile()->GetExtensionService();
+ // We might not have an ExtensionService (on ChromeOS when not logged in
+ // for example).
+ if (service)
+ web_ui->AddMessageHandler(new AppLauncherHandler(service));
#endif
web_ui->AddMessageHandler(new FaviconWebUIHandler());
@@ -293,13 +292,12 @@ void NewTabUI::RegisterUserPrefs(PrefServiceSyncable* prefs) {
// static
bool NewTabUI::ShouldShowApps() {
-#if defined(USE_ASH) || defined(OS_ANDROID)
+#if defined(OS_ANDROID)
// Ash shows apps in app list thus should not show apps page in NTP4.
// Android does not have apps.
return false;
#else
- return !CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kShowAppListShortcut);
+ return !extensions::IsAppLauncherEnabled();
#endif
}

Powered by Google App Engine
This is Rietveld 408576698