Index: apps/shell/browser/shell_extension_system_factory.cc |
diff --git a/apps/shell/browser/shell_extension_system_factory.cc b/apps/shell/browser/shell_extension_system_factory.cc |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e8352733f10f91ca8ec781ada1218930433d38c6 |
--- /dev/null |
+++ b/apps/shell/browser/shell_extension_system_factory.cc |
@@ -0,0 +1,48 @@ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#include "apps/shell/browser/shell_extension_system_factory.h" |
+ |
+#include "apps/shell/browser/shell_extension_system.h" |
+#include "components/browser_context_keyed_service/browser_context_dependency_manager.h" |
+#include "extensions/browser/extension_prefs_factory.h" |
+#include "extensions/browser/extension_registry_factory.h" |
+ |
+using content::BrowserContext; |
+ |
+namespace extensions { |
+ |
+ExtensionSystem* ShellExtensionSystemFactory::GetForBrowserContext( |
+ BrowserContext* context) { |
+ return static_cast<ShellExtensionSystem*>( |
+ GetInstance()->GetServiceForBrowserContext(context, true)); |
+} |
+ |
+// static |
+ShellExtensionSystemFactory* ShellExtensionSystemFactory::GetInstance() { |
+ return Singleton<ShellExtensionSystemFactory>::get(); |
+} |
+ |
+ShellExtensionSystemFactory::ShellExtensionSystemFactory() |
+ : ExtensionSystemProvider("ShellExtensionSystem", |
+ BrowserContextDependencyManager::GetInstance()) { |
+ DependsOn(ExtensionPrefsFactory::GetInstance()); |
+ DependsOn(ExtensionRegistryFactory::GetInstance()); |
+} |
+ |
+ShellExtensionSystemFactory::~ShellExtensionSystemFactory() {} |
+ |
+BrowserContextKeyedService* |
+ShellExtensionSystemFactory::BuildServiceInstanceFor(BrowserContext* context) |
+ const { |
+ return new ShellExtensionSystem(context); |
+} |
+ |
+BrowserContext* ShellExtensionSystemFactory::GetBrowserContextToUse( |
+ BrowserContext* context) const { |
+ // Use a separate instance for incognito. |
+ return context; |
+} |
+ |
+} // namespace extensions |