| 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_management.h" | 7 #include "chrome/browser/extensions/extension_management.h" |
| 8 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 8 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 10 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 11 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 11 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 12 #include "extensions/browser/extension_prefs_factory.h" | 12 #include "extensions/browser/extension_prefs_factory.h" |
| 13 #include "extensions/browser/extension_registry_factory.h" | 13 #include "extensions/browser/extension_registry_factory.h" |
| 14 #include "extensions/browser/extension_system.h" | 14 #include "extensions/browser/extension_system.h" |
| 15 #include "extensions/browser/extensions_browser_client.h" | 15 #include "extensions/browser/extensions_browser_client.h" |
| 16 #include "extensions/browser/process_manager_factory.h" |
| 16 #include "extensions/browser/renderer_startup_helper.h" | 17 #include "extensions/browser/renderer_startup_helper.h" |
| 17 | 18 |
| 18 namespace extensions { | 19 namespace extensions { |
| 19 | 20 |
| 20 // ExtensionSystemSharedFactory | 21 // ExtensionSystemSharedFactory |
| 21 | 22 |
| 22 // static | 23 // static |
| 23 ExtensionSystemImpl::Shared* | 24 ExtensionSystemImpl::Shared* |
| 24 ExtensionSystemSharedFactory::GetForBrowserContext( | 25 ExtensionSystemSharedFactory::GetForBrowserContext( |
| 25 content::BrowserContext* context) { | 26 content::BrowserContext* context) { |
| 26 return static_cast<ExtensionSystemImpl::Shared*>( | 27 return static_cast<ExtensionSystemImpl::Shared*>( |
| 27 GetInstance()->GetServiceForBrowserContext(context, true)); | 28 GetInstance()->GetServiceForBrowserContext(context, true)); |
| 28 } | 29 } |
| 29 | 30 |
| 30 // static | 31 // static |
| 31 ExtensionSystemSharedFactory* ExtensionSystemSharedFactory::GetInstance() { | 32 ExtensionSystemSharedFactory* ExtensionSystemSharedFactory::GetInstance() { |
| 32 return Singleton<ExtensionSystemSharedFactory>::get(); | 33 return Singleton<ExtensionSystemSharedFactory>::get(); |
| 33 } | 34 } |
| 34 | 35 |
| 35 ExtensionSystemSharedFactory::ExtensionSystemSharedFactory() | 36 ExtensionSystemSharedFactory::ExtensionSystemSharedFactory() |
| 36 : BrowserContextKeyedServiceFactory( | 37 : BrowserContextKeyedServiceFactory( |
| 37 "ExtensionSystemShared", | 38 "ExtensionSystemShared", |
| 38 BrowserContextDependencyManager::GetInstance()) { | 39 BrowserContextDependencyManager::GetInstance()) { |
| 39 DependsOn(ExtensionPrefsFactory::GetInstance()); | 40 DependsOn(ExtensionPrefsFactory::GetInstance()); |
| 40 DependsOn(ExtensionManagementFactory::GetInstance()); | 41 DependsOn(ExtensionManagementFactory::GetInstance()); |
| 41 // This depends on ExtensionService which depends on ExtensionRegistry. | 42 // This depends on ExtensionService which depends on ExtensionRegistry. |
| 42 DependsOn(ExtensionRegistryFactory::GetInstance()); | 43 DependsOn(ExtensionRegistryFactory::GetInstance()); |
| 43 DependsOn(GlobalErrorServiceFactory::GetInstance()); | 44 DependsOn(GlobalErrorServiceFactory::GetInstance()); |
| 44 DependsOn(policy::ProfilePolicyConnectorFactory::GetInstance()); | 45 DependsOn(policy::ProfilePolicyConnectorFactory::GetInstance()); |
| 46 DependsOn(ProcessManagerFactory::GetInstance()); |
| 45 DependsOn(RendererStartupHelperFactory::GetInstance()); | 47 DependsOn(RendererStartupHelperFactory::GetInstance()); |
| 46 } | 48 } |
| 47 | 49 |
| 48 ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() { | 50 ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() { |
| 49 } | 51 } |
| 50 | 52 |
| 51 KeyedService* ExtensionSystemSharedFactory::BuildServiceInstanceFor( | 53 KeyedService* ExtensionSystemSharedFactory::BuildServiceInstanceFor( |
| 52 content::BrowserContext* context) const { | 54 content::BrowserContext* context) const { |
| 53 return new ExtensionSystemImpl::Shared(static_cast<Profile*>(context)); | 55 return new ExtensionSystemImpl::Shared(static_cast<Profile*>(context)); |
| 54 } | 56 } |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 content::BrowserContext* context) const { | 95 content::BrowserContext* context) const { |
| 94 // Separate instance in incognito. | 96 // Separate instance in incognito. |
| 95 return context; | 97 return context; |
| 96 } | 98 } |
| 97 | 99 |
| 98 bool ExtensionSystemFactory::ServiceIsCreatedWithBrowserContext() const { | 100 bool ExtensionSystemFactory::ServiceIsCreatedWithBrowserContext() const { |
| 99 return true; | 101 return true; |
| 100 } | 102 } |
| 101 | 103 |
| 102 } // namespace extensions | 104 } // namespace extensions |
| OLD | NEW |