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

Side by Side Diff: extensions/browser/api/networking_config/networking_config_service_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
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/browser/api/networking_config/networking_config_service_fac tory.h" 5 #include "extensions/browser/api/networking_config/networking_config_service_fac tory.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "components/keyed_service/content/browser_context_dependency_manager.h" 9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10 #include "extensions/browser/api/networking_config/networking_config_service.h" 10 #include "extensions/browser/api/networking_config/networking_config_service.h"
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 47
48 // static 48 // static
49 NetworkingConfigService* NetworkingConfigServiceFactory::GetForBrowserContext( 49 NetworkingConfigService* NetworkingConfigServiceFactory::GetForBrowserContext(
50 content::BrowserContext* context) { 50 content::BrowserContext* context) {
51 return static_cast<NetworkingConfigService*>( 51 return static_cast<NetworkingConfigService*>(
52 GetInstance()->GetServiceForBrowserContext(context, true)); 52 GetInstance()->GetServiceForBrowserContext(context, true));
53 } 53 }
54 54
55 // static 55 // static
56 NetworkingConfigServiceFactory* NetworkingConfigServiceFactory::GetInstance() { 56 NetworkingConfigServiceFactory* NetworkingConfigServiceFactory::GetInstance() {
57 return Singleton<NetworkingConfigServiceFactory>::get(); 57 return base::Singleton<NetworkingConfigServiceFactory>::get();
58 } 58 }
59 59
60 NetworkingConfigServiceFactory::NetworkingConfigServiceFactory() 60 NetworkingConfigServiceFactory::NetworkingConfigServiceFactory()
61 : BrowserContextKeyedServiceFactory( 61 : BrowserContextKeyedServiceFactory(
62 "NetworkingConfigService", 62 "NetworkingConfigService",
63 BrowserContextDependencyManager::GetInstance()) { 63 BrowserContextDependencyManager::GetInstance()) {
64 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory()); 64 DependsOn(ExtensionsBrowserClient::Get()->GetExtensionSystemFactory());
65 DependsOn(extensions::ExtensionRegistryFactory::GetInstance()); 65 DependsOn(extensions::ExtensionRegistryFactory::GetInstance());
66 } 66 }
67 67
68 NetworkingConfigServiceFactory::~NetworkingConfigServiceFactory() { 68 NetworkingConfigServiceFactory::~NetworkingConfigServiceFactory() {
69 } 69 }
70 70
71 KeyedService* NetworkingConfigServiceFactory::BuildServiceInstanceFor( 71 KeyedService* NetworkingConfigServiceFactory::BuildServiceInstanceFor(
72 content::BrowserContext* context) const { 72 content::BrowserContext* context) const {
73 return new NetworkingConfigService( 73 return new NetworkingConfigService(
74 context, make_scoped_ptr(new DefaultEventDelegate(context)), 74 context, make_scoped_ptr(new DefaultEventDelegate(context)),
75 ExtensionRegistry::Get(context)); 75 ExtensionRegistry::Get(context));
76 } 76 }
77 77
78 content::BrowserContext* NetworkingConfigServiceFactory::GetBrowserContextToUse( 78 content::BrowserContext* NetworkingConfigServiceFactory::GetBrowserContextToUse(
79 content::BrowserContext* context) const { 79 content::BrowserContext* context) const {
80 return ExtensionsBrowserClient::Get()->GetOriginalContext(context); 80 return ExtensionsBrowserClient::Get()->GetOriginalContext(context);
81 } 81 }
82 82
83 } // namespace extensions 83 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698