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 dependent_factories; |
| 58 dependent_factories.insert( |
54 extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); | 59 extensions::ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); |
| 60 DriveAppProvider::AppendDependsOnFactories(&dependent_factories); |
| 61 for (FactorySet::iterator it = dependent_factories.begin(); |
| 62 it != dependent_factories.end(); |
| 63 ++it) { |
| 64 DependsOn(*it); |
| 65 } |
55 } | 66 } |
56 | 67 |
57 AppListSyncableServiceFactory::~AppListSyncableServiceFactory() { | 68 AppListSyncableServiceFactory::~AppListSyncableServiceFactory() { |
58 } | 69 } |
59 | 70 |
60 KeyedService* AppListSyncableServiceFactory::BuildServiceInstanceFor( | 71 KeyedService* AppListSyncableServiceFactory::BuildServiceInstanceFor( |
61 content::BrowserContext* browser_context) const { | 72 content::BrowserContext* browser_context) const { |
62 return BuildInstanceFor(static_cast<Profile*>(browser_context)); | 73 return BuildInstanceFor(static_cast<Profile*>(browser_context)); |
63 } | 74 } |
64 | 75 |
(...skipping 12 matching lines...) Expand all Loading... |
77 // Start AppListSyncableService early so that the app list positions are | 88 // Start AppListSyncableService early so that the app list positions are |
78 // available before the app list is opened. | 89 // available before the app list is opened. |
79 return true; | 90 return true; |
80 } | 91 } |
81 | 92 |
82 bool AppListSyncableServiceFactory::ServiceIsNULLWhileTesting() const { | 93 bool AppListSyncableServiceFactory::ServiceIsNULLWhileTesting() const { |
83 return true; | 94 return true; |
84 } | 95 } |
85 | 96 |
86 } // namespace app_list | 97 } // namespace app_list |
OLD | NEW |