summaryrefslogtreecommitdiffstats
path: root/chrome/browser/dom_ui/new_tab_ui.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/dom_ui/new_tab_ui.cc')
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index 693618e..b605522 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -505,9 +505,12 @@ NewTabUI::NewTabUI(TabContents* contents)
if (ProfileSyncService::IsSyncEnabled()) {
AddMessageHandler((new NewTabPageSyncHandler())->Attach(this));
}
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableApps)) {
+ if (Extension::AppsAreEnabled()) {
ExtensionsService* service = GetProfile()->GetExtensionsService();
- AddMessageHandler((new AppLauncherHandler(service))->Attach(this));
+ // We might not have an ExtensionsService (on ChromeOS when not logged in
+ // for example).
+ if (service)
+ AddMessageHandler((new AppLauncherHandler(service))->Attach(this));
}
AddMessageHandler((new NewTabPageSetHomePageHandler())->Attach(this));