Index: chrome/browser/ui/app_list/app_list_syncable_service_factory.cc |
diff --git a/chrome/browser/ui/app_list/app_list_syncable_service_factory.cc b/chrome/browser/ui/app_list/app_list_syncable_service_factory.cc |
index d34b213111e75f224a07585c803b0f96634bec32..db66cf882c699d0d30fbf1f710a4bd7497b3387f 100644 |
--- a/chrome/browser/ui/app_list/app_list_syncable_service_factory.cc |
+++ b/chrome/browser/ui/app_list/app_list_syncable_service_factory.cc |
@@ -27,10 +27,20 @@ AppListSyncableServiceFactory* AppListSyncableServiceFactory::GetInstance() { |
return Singleton<AppListSyncableServiceFactory>::get(); |
} |
+// static |
+KeyedService* AppListSyncableServiceFactory::BuildInstanceFor( |
+ content::BrowserContext* browser_context) { |
+ Profile* profile = static_cast<Profile*>(browser_context); |
+ VLOG(1) << "BuildServiceInstanceFor: " << profile->GetDebugName(); |
+ return new AppListSyncableService(profile, |
+ extensions::ExtensionSystem::Get(profile)); |
+} |
+ |
AppListSyncableServiceFactory::AppListSyncableServiceFactory() |
: BrowserContextKeyedServiceFactory( |
"AppListSyncableService", |
BrowserContextDependencyManager::GetInstance()) { |
+ VLOG(1) << "AppListSyncableServiceFactory()"; |
DependsOn( |
extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
} |
@@ -40,9 +50,7 @@ AppListSyncableServiceFactory::~AppListSyncableServiceFactory() { |
KeyedService* AppListSyncableServiceFactory::BuildServiceInstanceFor( |
content::BrowserContext* browser_context) const { |
- Profile* profile = static_cast<Profile*>(browser_context); |
- return new AppListSyncableService(profile, |
- extensions::ExtensionSystem::Get(profile)); |
+ return BuildInstanceFor(static_cast<Profile*>(browser_context)); |
} |
void AppListSyncableServiceFactory::RegisterProfilePrefs( |
@@ -59,4 +67,14 @@ content::BrowserContext* AppListSyncableServiceFactory::GetBrowserContextToUse( |
return chrome::GetBrowserContextRedirectedInIncognito(context); |
} |
+bool AppListSyncableServiceFactory::ServiceIsCreatedWithBrowserContext() const { |
+ // Start AppListSyncableService early so that the app list positions are |
+ // available before the app list is opened. |
+ return true; |
+} |
+ |
+bool AppListSyncableServiceFactory::ServiceIsNULLWhileTesting() const { |
+ return true; |
+} |
+ |
} // namespace app_list |