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

Side by Side Diff: extensions/browser/warning_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
« no previous file with comments | « extensions/browser/warning_service_factory.h ('k') | extensions/common/extension_api.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/browser/warning_service_factory.h" 5 #include "extensions/browser/warning_service_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_registry_factory.h" 8 #include "extensions/browser/extension_registry_factory.h"
9 #include "extensions/browser/extensions_browser_client.h" 9 #include "extensions/browser/extensions_browser_client.h"
10 #include "extensions/browser/warning_service.h" 10 #include "extensions/browser/warning_service.h"
11 11
12 using content::BrowserContext; 12 using content::BrowserContext;
13 13
14 namespace extensions { 14 namespace extensions {
15 15
16 // static 16 // static
17 WarningService* WarningServiceFactory::GetForBrowserContext( 17 WarningService* WarningServiceFactory::GetForBrowserContext(
18 BrowserContext* context) { 18 BrowserContext* context) {
19 return static_cast<WarningService*>( 19 return static_cast<WarningService*>(
20 GetInstance()->GetServiceForBrowserContext(context, true)); 20 GetInstance()->GetServiceForBrowserContext(context, true));
21 } 21 }
22 22
23 // static 23 // static
24 WarningServiceFactory* WarningServiceFactory::GetInstance() { 24 WarningServiceFactory* WarningServiceFactory::GetInstance() {
25 return Singleton<WarningServiceFactory>::get(); 25 return base::Singleton<WarningServiceFactory>::get();
26 } 26 }
27 27
28 WarningServiceFactory::WarningServiceFactory() 28 WarningServiceFactory::WarningServiceFactory()
29 : BrowserContextKeyedServiceFactory( 29 : BrowserContextKeyedServiceFactory(
30 "WarningService", 30 "WarningService",
31 BrowserContextDependencyManager::GetInstance()) { 31 BrowserContextDependencyManager::GetInstance()) {
32 DependsOn(ExtensionRegistryFactory::GetInstance()); 32 DependsOn(ExtensionRegistryFactory::GetInstance());
33 } 33 }
34 34
35 WarningServiceFactory::~WarningServiceFactory() { 35 WarningServiceFactory::~WarningServiceFactory() {
36 } 36 }
37 37
38 KeyedService* WarningServiceFactory::BuildServiceInstanceFor( 38 KeyedService* WarningServiceFactory::BuildServiceInstanceFor(
39 BrowserContext* context) const { 39 BrowserContext* context) const {
40 return new WarningService(context); 40 return new WarningService(context);
41 } 41 }
42 42
43 BrowserContext* WarningServiceFactory::GetBrowserContextToUse( 43 BrowserContext* WarningServiceFactory::GetBrowserContextToUse(
44 BrowserContext* context) const { 44 BrowserContext* context) const {
45 // Redirected in incognito. 45 // Redirected in incognito.
46 return ExtensionsBrowserClient::Get()->GetOriginalContext(context); 46 return ExtensionsBrowserClient::Get()->GetOriginalContext(context);
47 } 47 }
48 48
49 } // namespace extensions 49 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/warning_service_factory.h ('k') | extensions/common/extension_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698