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

Unified Diff: chrome/browser/ui/app_list/app_list_syncable_service_factory.cc

Issue 217483004: Create AppListSyncableService with BrowserContext (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 6 years, 9 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
« no previous file with comments | « chrome/browser/ui/app_list/app_list_syncable_service_factory.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/browser/ui/app_list/app_list_syncable_service_factory.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698