Index: chrome/browser/dom_ui/new_tab_ui.cc |
=================================================================== |
--- chrome/browser/dom_ui/new_tab_ui.cc (revision 48045) |
+++ chrome/browser/dom_ui/new_tab_ui.cc (working copy) |
@@ -505,9 +505,12 @@ |
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)); |