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/blacklist_factory.h" | 7 #include "chrome/browser/extensions/blacklist_factory.h" |
8 #include "chrome/browser/extensions/extension_management.h" | 8 #include "chrome/browser/extensions/extension_management.h" |
9 #include "chrome/browser/extensions/install_verifier_factory.h" | 9 #include "chrome/browser/extensions/install_verifier_factory.h" |
10 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 10 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 // static | 28 // static |
29 ExtensionSystemImpl::Shared* | 29 ExtensionSystemImpl::Shared* |
30 ExtensionSystemSharedFactory::GetForBrowserContext( | 30 ExtensionSystemSharedFactory::GetForBrowserContext( |
31 content::BrowserContext* context) { | 31 content::BrowserContext* context) { |
32 return static_cast<ExtensionSystemImpl::Shared*>( | 32 return static_cast<ExtensionSystemImpl::Shared*>( |
33 GetInstance()->GetServiceForBrowserContext(context, true)); | 33 GetInstance()->GetServiceForBrowserContext(context, true)); |
34 } | 34 } |
35 | 35 |
36 // static | 36 // static |
37 ExtensionSystemSharedFactory* ExtensionSystemSharedFactory::GetInstance() { | 37 ExtensionSystemSharedFactory* ExtensionSystemSharedFactory::GetInstance() { |
38 return Singleton<ExtensionSystemSharedFactory>::get(); | 38 return base::Singleton<ExtensionSystemSharedFactory>::get(); |
39 } | 39 } |
40 | 40 |
41 ExtensionSystemSharedFactory::ExtensionSystemSharedFactory() | 41 ExtensionSystemSharedFactory::ExtensionSystemSharedFactory() |
42 : BrowserContextKeyedServiceFactory( | 42 : BrowserContextKeyedServiceFactory( |
43 "ExtensionSystemShared", | 43 "ExtensionSystemShared", |
44 BrowserContextDependencyManager::GetInstance()) { | 44 BrowserContextDependencyManager::GetInstance()) { |
45 DependsOn(ExtensionPrefsFactory::GetInstance()); | 45 DependsOn(ExtensionPrefsFactory::GetInstance()); |
46 DependsOn(ExtensionManagementFactory::GetInstance()); | 46 DependsOn(ExtensionManagementFactory::GetInstance()); |
47 // This depends on ExtensionService which depends on ExtensionRegistry. | 47 // This depends on ExtensionService which depends on ExtensionRegistry. |
48 DependsOn(ExtensionRegistryFactory::GetInstance()); | 48 DependsOn(ExtensionRegistryFactory::GetInstance()); |
(...skipping 28 matching lines...) Expand all Loading... |
77 | 77 |
78 // static | 78 // static |
79 ExtensionSystem* ExtensionSystemFactory::GetForBrowserContext( | 79 ExtensionSystem* ExtensionSystemFactory::GetForBrowserContext( |
80 content::BrowserContext* context) { | 80 content::BrowserContext* context) { |
81 return static_cast<ExtensionSystem*>( | 81 return static_cast<ExtensionSystem*>( |
82 GetInstance()->GetServiceForBrowserContext(context, true)); | 82 GetInstance()->GetServiceForBrowserContext(context, true)); |
83 } | 83 } |
84 | 84 |
85 // static | 85 // static |
86 ExtensionSystemFactory* ExtensionSystemFactory::GetInstance() { | 86 ExtensionSystemFactory* ExtensionSystemFactory::GetInstance() { |
87 return Singleton<ExtensionSystemFactory>::get(); | 87 return base::Singleton<ExtensionSystemFactory>::get(); |
88 } | 88 } |
89 | 89 |
90 ExtensionSystemFactory::ExtensionSystemFactory() | 90 ExtensionSystemFactory::ExtensionSystemFactory() |
91 : ExtensionSystemProvider("ExtensionSystem", | 91 : ExtensionSystemProvider("ExtensionSystem", |
92 BrowserContextDependencyManager::GetInstance()) { | 92 BrowserContextDependencyManager::GetInstance()) { |
93 DCHECK(ExtensionsBrowserClient::Get()) | 93 DCHECK(ExtensionsBrowserClient::Get()) |
94 << "ExtensionSystemFactory must be initialized after BrowserProcess"; | 94 << "ExtensionSystemFactory must be initialized after BrowserProcess"; |
95 DependsOn(ExtensionSystemSharedFactory::GetInstance()); | 95 DependsOn(ExtensionSystemSharedFactory::GetInstance()); |
96 } | 96 } |
97 | 97 |
98 ExtensionSystemFactory::~ExtensionSystemFactory() { | 98 ExtensionSystemFactory::~ExtensionSystemFactory() { |
99 } | 99 } |
100 | 100 |
101 KeyedService* ExtensionSystemFactory::BuildServiceInstanceFor( | 101 KeyedService* ExtensionSystemFactory::BuildServiceInstanceFor( |
102 content::BrowserContext* context) const { | 102 content::BrowserContext* context) const { |
103 return new ExtensionSystemImpl(static_cast<Profile*>(context)); | 103 return new ExtensionSystemImpl(static_cast<Profile*>(context)); |
104 } | 104 } |
105 | 105 |
106 content::BrowserContext* ExtensionSystemFactory::GetBrowserContextToUse( | 106 content::BrowserContext* ExtensionSystemFactory::GetBrowserContextToUse( |
107 content::BrowserContext* context) const { | 107 content::BrowserContext* context) const { |
108 // Separate instance in incognito. | 108 // Separate instance in incognito. |
109 return context; | 109 return context; |
110 } | 110 } |
111 | 111 |
112 bool ExtensionSystemFactory::ServiceIsCreatedWithBrowserContext() const { | 112 bool ExtensionSystemFactory::ServiceIsCreatedWithBrowserContext() const { |
113 return true; | 113 return true; |
114 } | 114 } |
115 | 115 |
116 } // namespace extensions | 116 } // namespace extensions |
OLD | NEW |