OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/extensions/extension_system_factory.h" | 5 #include "chrome/browser/extensions/extension_system_factory.h" |
6 | 6 |
7 #include "chrome/browser/extensions/extension_prefs_factory.h" | 7 #include "chrome/browser/extensions/extension_prefs_factory.h" |
8 #include "chrome/browser/extensions/extension_system.h" | 8 #include "chrome/browser/extensions/extension_system.h" |
9 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 9 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 11 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
12 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 12 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
| 13 #include "extensions/browser/extension_registry_factory.h" |
13 #include "extensions/browser/extensions_browser_client.h" | 14 #include "extensions/browser/extensions_browser_client.h" |
14 | 15 |
15 namespace extensions { | 16 namespace extensions { |
16 | 17 |
17 // ExtensionSystemSharedFactory | 18 // ExtensionSystemSharedFactory |
18 | 19 |
19 // static | 20 // static |
20 ExtensionSystemImpl::Shared* | 21 ExtensionSystemImpl::Shared* |
21 ExtensionSystemSharedFactory::GetForProfile(Profile* profile) { | 22 ExtensionSystemSharedFactory::GetForProfile(Profile* profile) { |
22 return static_cast<ExtensionSystemImpl::Shared*>( | 23 return static_cast<ExtensionSystemImpl::Shared*>( |
23 GetInstance()->GetServiceForBrowserContext(profile, true)); | 24 GetInstance()->GetServiceForBrowserContext(profile, true)); |
24 } | 25 } |
25 | 26 |
26 // static | 27 // static |
27 ExtensionSystemSharedFactory* ExtensionSystemSharedFactory::GetInstance() { | 28 ExtensionSystemSharedFactory* ExtensionSystemSharedFactory::GetInstance() { |
28 return Singleton<ExtensionSystemSharedFactory>::get(); | 29 return Singleton<ExtensionSystemSharedFactory>::get(); |
29 } | 30 } |
30 | 31 |
31 ExtensionSystemSharedFactory::ExtensionSystemSharedFactory() | 32 ExtensionSystemSharedFactory::ExtensionSystemSharedFactory() |
32 : BrowserContextKeyedServiceFactory( | 33 : BrowserContextKeyedServiceFactory( |
33 "ExtensionSystemShared", | 34 "ExtensionSystemShared", |
34 BrowserContextDependencyManager::GetInstance()) { | 35 BrowserContextDependencyManager::GetInstance()) { |
35 DependsOn(ExtensionPrefsFactory::GetInstance()); | 36 DependsOn(ExtensionPrefsFactory::GetInstance()); |
| 37 // This depends on ExtensionService which depends on ExtensionRegistry. |
| 38 DependsOn(ExtensionRegistryFactory::GetInstance()); |
36 DependsOn(GlobalErrorServiceFactory::GetInstance()); | 39 DependsOn(GlobalErrorServiceFactory::GetInstance()); |
37 DependsOn(policy::ProfilePolicyConnectorFactory::GetInstance()); | 40 DependsOn(policy::ProfilePolicyConnectorFactory::GetInstance()); |
38 } | 41 } |
39 | 42 |
40 ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() { | 43 ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() { |
41 } | 44 } |
42 | 45 |
43 BrowserContextKeyedService* | 46 BrowserContextKeyedService* |
44 ExtensionSystemSharedFactory::BuildServiceInstanceFor( | 47 ExtensionSystemSharedFactory::BuildServiceInstanceFor( |
45 content::BrowserContext* profile) const { | 48 content::BrowserContext* profile) const { |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 content::BrowserContext* context) const { | 96 content::BrowserContext* context) const { |
94 // Separate instance in incognito. | 97 // Separate instance in incognito. |
95 return context; | 98 return context; |
96 } | 99 } |
97 | 100 |
98 bool ExtensionSystemFactory::ServiceIsCreatedWithBrowserContext() const { | 101 bool ExtensionSystemFactory::ServiceIsCreatedWithBrowserContext() const { |
99 return true; | 102 return true; |
100 } | 103 } |
101 | 104 |
102 } // namespace extensions | 105 } // namespace extensions |
OLD | NEW |