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

Side by Side Diff: chrome/browser/ui/global_error/global_error_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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/global_error/global_error_service_factory.h" 5 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
6 6
7 #include "chrome/browser/profiles/incognito_helpers.h" 7 #include "chrome/browser/profiles/incognito_helpers.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/global_error/global_error_service.h" 9 #include "chrome/browser/ui/global_error/global_error_service.h"
10 #include "components/keyed_service/content/browser_context_dependency_manager.h" 10 #include "components/keyed_service/content/browser_context_dependency_manager.h"
11 11
12 // static 12 // static
13 GlobalErrorService* GlobalErrorServiceFactory::GetForProfile(Profile* profile) { 13 GlobalErrorService* GlobalErrorServiceFactory::GetForProfile(Profile* profile) {
14 return static_cast<GlobalErrorService*>( 14 return static_cast<GlobalErrorService*>(
15 GetInstance()->GetServiceForBrowserContext(profile, true)); 15 GetInstance()->GetServiceForBrowserContext(profile, true));
16 } 16 }
17 17
18 // static 18 // static
19 GlobalErrorServiceFactory* GlobalErrorServiceFactory::GetInstance() { 19 GlobalErrorServiceFactory* GlobalErrorServiceFactory::GetInstance() {
20 return Singleton<GlobalErrorServiceFactory>::get(); 20 return base::Singleton<GlobalErrorServiceFactory>::get();
21 } 21 }
22 22
23 GlobalErrorServiceFactory::GlobalErrorServiceFactory() 23 GlobalErrorServiceFactory::GlobalErrorServiceFactory()
24 : BrowserContextKeyedServiceFactory( 24 : BrowserContextKeyedServiceFactory(
25 "GlobalErrorService", 25 "GlobalErrorService",
26 BrowserContextDependencyManager::GetInstance()) { 26 BrowserContextDependencyManager::GetInstance()) {
27 } 27 }
28 28
29 GlobalErrorServiceFactory::~GlobalErrorServiceFactory() { 29 GlobalErrorServiceFactory::~GlobalErrorServiceFactory() {
30 } 30 }
31 31
32 KeyedService* GlobalErrorServiceFactory::BuildServiceInstanceFor( 32 KeyedService* GlobalErrorServiceFactory::BuildServiceInstanceFor(
33 content::BrowserContext* profile) const { 33 content::BrowserContext* profile) const {
34 return new GlobalErrorService(static_cast<Profile*>(profile)); 34 return new GlobalErrorService(static_cast<Profile*>(profile));
35 } 35 }
36 36
37 content::BrowserContext* GlobalErrorServiceFactory::GetBrowserContextToUse( 37 content::BrowserContext* GlobalErrorServiceFactory::GetBrowserContextToUse(
38 content::BrowserContext* context) const { 38 content::BrowserContext* context) const {
39 return chrome::GetBrowserContextRedirectedInIncognito(context); 39 return chrome::GetBrowserContextRedirectedInIncognito(context);
40 } 40 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/global_error/global_error_service_factory.h ('k') | chrome/browser/ui/libgtk2ui/g_object_destructor_filo.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698