OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" | 5 #include "chrome/browser/ui/app_list/app_list_syncable_service_factory.h" |
6 | 6 |
7 #include <set> | |
8 | |
7 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "chrome/browser/apps/drive/drive_app_provider.h" | |
8 #include "chrome/browser/profiles/incognito_helpers.h" | 11 #include "chrome/browser/profiles/incognito_helpers.h" |
9 #include "chrome/browser/profiles/profile.h" | 12 #include "chrome/browser/profiles/profile.h" |
10 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" | 13 #include "chrome/browser/ui/app_list/app_list_syncable_service.h" |
11 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 14 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
12 #include "extensions/browser/extension_system.h" | 15 #include "extensions/browser/extension_system.h" |
13 #include "extensions/browser/extension_system_provider.h" | 16 #include "extensions/browser/extension_system_provider.h" |
14 #include "extensions/browser/extensions_browser_client.h" | 17 #include "extensions/browser/extensions_browser_client.h" |
15 | 18 |
16 #if defined(OS_CHROMEOS) | 19 #if defined(OS_CHROMEOS) |
17 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 20 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
(...skipping 25 matching lines...) Expand all Loading... | |
43 << " (" << profile << ")"; | 46 << " (" << profile << ")"; |
44 return new AppListSyncableService(profile, | 47 return new AppListSyncableService(profile, |
45 extensions::ExtensionSystem::Get(profile)); | 48 extensions::ExtensionSystem::Get(profile)); |
46 } | 49 } |
47 | 50 |
48 AppListSyncableServiceFactory::AppListSyncableServiceFactory() | 51 AppListSyncableServiceFactory::AppListSyncableServiceFactory() |
49 : BrowserContextKeyedServiceFactory( | 52 : BrowserContextKeyedServiceFactory( |
50 "AppListSyncableService", | 53 "AppListSyncableService", |
51 BrowserContextDependencyManager::GetInstance()) { | 54 BrowserContextDependencyManager::GetInstance()) { |
52 VLOG(1) << "AppListSyncableServiceFactory()"; | 55 VLOG(1) << "AppListSyncableServiceFactory()"; |
53 DependsOn( | 56 typedef std::set<BrowserContextKeyedServiceFactory*> FactorySet; |
57 FactorySet factories; | |
stevenjb
2014/06/05 20:15:16
nit: 'dependent_factories'
xiyuan
2014/06/05 20:36:14
Done in the next patch.
| |
58 factories.insert( | |
54 extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 59 extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
60 DriveAppProvider::AppendDependsOnFactories(&factories); | |
61 for (FactorySet::iterator it = factories.begin(); it != factories.end(); | |
62 ++it) { | |
63 DependsOn(*it); | |
64 } | |
55 } | 65 } |
56 | 66 |
57 AppListSyncableServiceFactory::~AppListSyncableServiceFactory() { | 67 AppListSyncableServiceFactory::~AppListSyncableServiceFactory() { |
58 } | 68 } |
59 | 69 |
60 KeyedService* AppListSyncableServiceFactory::BuildServiceInstanceFor( | 70 KeyedService* AppListSyncableServiceFactory::BuildServiceInstanceFor( |
61 content::BrowserContext* browser_context) const { | 71 content::BrowserContext* browser_context) const { |
62 return BuildInstanceFor(static_cast<Profile*>(browser_context)); | 72 return BuildInstanceFor(static_cast<Profile*>(browser_context)); |
63 } | 73 } |
64 | 74 |
(...skipping 12 matching lines...) Expand all Loading... | |
77 // Start AppListSyncableService early so that the app list positions are | 87 // Start AppListSyncableService early so that the app list positions are |
78 // available before the app list is opened. | 88 // available before the app list is opened. |
79 return true; | 89 return true; |
80 } | 90 } |
81 | 91 |
82 bool AppListSyncableServiceFactory::ServiceIsNULLWhileTesting() const { | 92 bool AppListSyncableServiceFactory::ServiceIsNULLWhileTesting() const { |
83 return true; | 93 return true; |
84 } | 94 } |
85 | 95 |
86 } // namespace app_list | 96 } // namespace app_list |
OLD | NEW |