| 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/policy/profile_policy_connector_factory.h" | 7 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 9 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 10 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 10 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
| 11 #include "extensions/browser/extension_prefs_factory.h" | 11 #include "extensions/browser/extension_prefs_factory.h" |
| 12 #include "extensions/browser/extension_registry_factory.h" | 12 #include "extensions/browser/extension_registry_factory.h" |
| 13 #include "extensions/browser/extension_system.h" | 13 #include "extensions/browser/extension_system.h" |
| 14 #include "extensions/browser/extensions_browser_client.h" | 14 #include "extensions/browser/extensions_browser_client.h" |
| 15 #include "extensions/browser/renderer_startup_helper.h" | 15 #include "extensions/browser/renderer_startup_helper.h" |
| 16 | 16 |
| 17 namespace extensions { | 17 namespace extensions { |
| 18 | 18 |
| 19 // ExtensionSystemSharedFactory | 19 // ExtensionSystemSharedFactory |
| 20 | 20 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 39 // This depends on ExtensionService which depends on ExtensionRegistry. | 39 // This depends on ExtensionService which depends on ExtensionRegistry. |
| 40 DependsOn(ExtensionRegistryFactory::GetInstance()); | 40 DependsOn(ExtensionRegistryFactory::GetInstance()); |
| 41 DependsOn(GlobalErrorServiceFactory::GetInstance()); | 41 DependsOn(GlobalErrorServiceFactory::GetInstance()); |
| 42 DependsOn(policy::ProfilePolicyConnectorFactory::GetInstance()); | 42 DependsOn(policy::ProfilePolicyConnectorFactory::GetInstance()); |
| 43 DependsOn(RendererStartupHelperFactory::GetInstance()); | 43 DependsOn(RendererStartupHelperFactory::GetInstance()); |
| 44 } | 44 } |
| 45 | 45 |
| 46 ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() { | 46 ExtensionSystemSharedFactory::~ExtensionSystemSharedFactory() { |
| 47 } | 47 } |
| 48 | 48 |
| 49 BrowserContextKeyedService* | 49 KeyedService* ExtensionSystemSharedFactory::BuildServiceInstanceFor( |
| 50 ExtensionSystemSharedFactory::BuildServiceInstanceFor( | |
| 51 content::BrowserContext* context) const { | 50 content::BrowserContext* context) const { |
| 52 return new ExtensionSystemImpl::Shared(static_cast<Profile*>(context)); | 51 return new ExtensionSystemImpl::Shared(static_cast<Profile*>(context)); |
| 53 } | 52 } |
| 54 | 53 |
| 55 content::BrowserContext* ExtensionSystemSharedFactory::GetBrowserContextToUse( | 54 content::BrowserContext* ExtensionSystemSharedFactory::GetBrowserContextToUse( |
| 56 content::BrowserContext* context) const { | 55 content::BrowserContext* context) const { |
| 57 // Redirected in incognito. | 56 // Redirected in incognito. |
| 58 return ExtensionsBrowserClient::Get()->GetOriginalContext(context); | 57 return ExtensionsBrowserClient::Get()->GetOriginalContext(context); |
| 59 } | 58 } |
| 60 | 59 |
| (...skipping 15 matching lines...) Expand all Loading... |
| 76 : ExtensionSystemProvider("ExtensionSystem", | 75 : ExtensionSystemProvider("ExtensionSystem", |
| 77 BrowserContextDependencyManager::GetInstance()) { | 76 BrowserContextDependencyManager::GetInstance()) { |
| 78 DCHECK(ExtensionsBrowserClient::Get()) | 77 DCHECK(ExtensionsBrowserClient::Get()) |
| 79 << "ExtensionSystemFactory must be initialized after BrowserProcess"; | 78 << "ExtensionSystemFactory must be initialized after BrowserProcess"; |
| 80 DependsOn(ExtensionSystemSharedFactory::GetInstance()); | 79 DependsOn(ExtensionSystemSharedFactory::GetInstance()); |
| 81 } | 80 } |
| 82 | 81 |
| 83 ExtensionSystemFactory::~ExtensionSystemFactory() { | 82 ExtensionSystemFactory::~ExtensionSystemFactory() { |
| 84 } | 83 } |
| 85 | 84 |
| 86 BrowserContextKeyedService* ExtensionSystemFactory::BuildServiceInstanceFor( | 85 KeyedService* ExtensionSystemFactory::BuildServiceInstanceFor( |
| 87 content::BrowserContext* context) const { | 86 content::BrowserContext* context) const { |
| 88 return new ExtensionSystemImpl(static_cast<Profile*>(context)); | 87 return new ExtensionSystemImpl(static_cast<Profile*>(context)); |
| 89 } | 88 } |
| 90 | 89 |
| 91 content::BrowserContext* ExtensionSystemFactory::GetBrowserContextToUse( | 90 content::BrowserContext* ExtensionSystemFactory::GetBrowserContextToUse( |
| 92 content::BrowserContext* context) const { | 91 content::BrowserContext* context) const { |
| 93 // Separate instance in incognito. | 92 // Separate instance in incognito. |
| 94 return context; | 93 return context; |
| 95 } | 94 } |
| 96 | 95 |
| 97 bool ExtensionSystemFactory::ServiceIsCreatedWithBrowserContext() const { | 96 bool ExtensionSystemFactory::ServiceIsCreatedWithBrowserContext() const { |
| 98 return true; | 97 return true; |
| 99 } | 98 } |
| 100 | 99 |
| 101 } // namespace extensions | 100 } // namespace extensions |
| OLD | NEW |