1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "extensions/shell/browser/shell_extension_system_factory.h"
7 #include "components/keyed_service/content/browser_context_dependency_manager.h"
8 #include "extensions/browser/extension_prefs_factory.h"
9 #include "extensions/browser/extension_registry_factory.h"
10 #include "extensions/shell/browser/shell_extension_system.h"
12 using content::BrowserContext
;
14 namespace extensions
{
16 ExtensionSystem
* ShellExtensionSystemFactory::GetForBrowserContext(
17 BrowserContext
* context
) {
18 return static_cast<ShellExtensionSystem
*>(
19 GetInstance()->GetServiceForBrowserContext(context
, true));
23 ShellExtensionSystemFactory
* ShellExtensionSystemFactory::GetInstance() {
24 return base::Singleton
<ShellExtensionSystemFactory
>::get();
27 ShellExtensionSystemFactory::ShellExtensionSystemFactory()
28 : ExtensionSystemProvider("ShellExtensionSystem",
29 BrowserContextDependencyManager::GetInstance()) {
30 DependsOn(ExtensionPrefsFactory::GetInstance());
31 DependsOn(ExtensionRegistryFactory::GetInstance());
34 ShellExtensionSystemFactory::~ShellExtensionSystemFactory() {
37 KeyedService
* ShellExtensionSystemFactory::BuildServiceInstanceFor(
38 BrowserContext
* context
) const {
39 return new ShellExtensionSystem(context
);
42 BrowserContext
* ShellExtensionSystemFactory::GetBrowserContextToUse(
43 BrowserContext
* context
) const {
44 // Use a separate instance for incognito.
48 bool ShellExtensionSystemFactory::ServiceIsCreatedWithBrowserContext() const {
52 } // namespace extensions