Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(478)

Side by Side Diff: extensions/shell/browser/shell_extension_system_factory.cc

Issue 1308823002: Move Singleton and related structs to namespace base (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « extensions/shell/browser/shell_extension_system_factory.h ('k') | google_apis/gaia/gaia_urls.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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 "extensions/shell/browser/shell_extension_system_factory.h" 5 #include "extensions/shell/browser/shell_extension_system_factory.h"
6 6
7 #include "components/keyed_service/content/browser_context_dependency_manager.h" 7 #include "components/keyed_service/content/browser_context_dependency_manager.h"
8 #include "extensions/browser/extension_prefs_factory.h" 8 #include "extensions/browser/extension_prefs_factory.h"
9 #include "extensions/browser/extension_registry_factory.h" 9 #include "extensions/browser/extension_registry_factory.h"
10 #include "extensions/shell/browser/shell_extension_system.h" 10 #include "extensions/shell/browser/shell_extension_system.h"
11 11
12 using content::BrowserContext; 12 using content::BrowserContext;
13 13
14 namespace extensions { 14 namespace extensions {
15 15
16 ExtensionSystem* ShellExtensionSystemFactory::GetForBrowserContext( 16 ExtensionSystem* ShellExtensionSystemFactory::GetForBrowserContext(
17 BrowserContext* context) { 17 BrowserContext* context) {
18 return static_cast<ShellExtensionSystem*>( 18 return static_cast<ShellExtensionSystem*>(
19 GetInstance()->GetServiceForBrowserContext(context, true)); 19 GetInstance()->GetServiceForBrowserContext(context, true));
20 } 20 }
21 21
22 // static 22 // static
23 ShellExtensionSystemFactory* ShellExtensionSystemFactory::GetInstance() { 23 ShellExtensionSystemFactory* ShellExtensionSystemFactory::GetInstance() {
24 return Singleton<ShellExtensionSystemFactory>::get(); 24 return base::Singleton<ShellExtensionSystemFactory>::get();
25 } 25 }
26 26
27 ShellExtensionSystemFactory::ShellExtensionSystemFactory() 27 ShellExtensionSystemFactory::ShellExtensionSystemFactory()
28 : ExtensionSystemProvider("ShellExtensionSystem", 28 : ExtensionSystemProvider("ShellExtensionSystem",
29 BrowserContextDependencyManager::GetInstance()) { 29 BrowserContextDependencyManager::GetInstance()) {
30 DependsOn(ExtensionPrefsFactory::GetInstance()); 30 DependsOn(ExtensionPrefsFactory::GetInstance());
31 DependsOn(ExtensionRegistryFactory::GetInstance()); 31 DependsOn(ExtensionRegistryFactory::GetInstance());
32 } 32 }
33 33
34 ShellExtensionSystemFactory::~ShellExtensionSystemFactory() { 34 ShellExtensionSystemFactory::~ShellExtensionSystemFactory() {
35 } 35 }
36 36
37 KeyedService* ShellExtensionSystemFactory::BuildServiceInstanceFor( 37 KeyedService* ShellExtensionSystemFactory::BuildServiceInstanceFor(
38 BrowserContext* context) const { 38 BrowserContext* context) const {
39 return new ShellExtensionSystem(context); 39 return new ShellExtensionSystem(context);
40 } 40 }
41 41
42 BrowserContext* ShellExtensionSystemFactory::GetBrowserContextToUse( 42 BrowserContext* ShellExtensionSystemFactory::GetBrowserContextToUse(
43 BrowserContext* context) const { 43 BrowserContext* context) const {
44 // Use a separate instance for incognito. 44 // Use a separate instance for incognito.
45 return context; 45 return context;
46 } 46 }
47 47
48 bool ShellExtensionSystemFactory::ServiceIsCreatedWithBrowserContext() const { 48 bool ShellExtensionSystemFactory::ServiceIsCreatedWithBrowserContext() const {
49 return true; 49 return true;
50 } 50 }
51 51
52 } // namespace extensions 52 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/shell/browser/shell_extension_system_factory.h ('k') | google_apis/gaia/gaia_urls.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698