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

Side by Side Diff: chrome/browser/supervised_user/supervised_user_settings_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 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 "chrome/browser/supervised_user/supervised_user_settings_service_factor y.h" 5 #include "chrome/browser/supervised_user/supervised_user_settings_service_factor y.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/supervised_user/supervised_user_settings_service.h" 9 #include "chrome/browser/supervised_user/supervised_user_settings_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 SupervisedUserSettingsService* 13 SupervisedUserSettingsService*
14 SupervisedUserSettingsServiceFactory::GetForProfile(Profile* profile) { 14 SupervisedUserSettingsServiceFactory::GetForProfile(Profile* profile) {
15 return static_cast<SupervisedUserSettingsService*>( 15 return static_cast<SupervisedUserSettingsService*>(
16 GetInstance()->GetServiceForBrowserContext(profile, true)); 16 GetInstance()->GetServiceForBrowserContext(profile, true));
17 } 17 }
18 18
19 // static 19 // static
20 SupervisedUserSettingsServiceFactory* 20 SupervisedUserSettingsServiceFactory*
21 SupervisedUserSettingsServiceFactory::GetInstance() { 21 SupervisedUserSettingsServiceFactory::GetInstance() {
22 return Singleton<SupervisedUserSettingsServiceFactory>::get(); 22 return base::Singleton<SupervisedUserSettingsServiceFactory>::get();
23 } 23 }
24 24
25 SupervisedUserSettingsServiceFactory::SupervisedUserSettingsServiceFactory() 25 SupervisedUserSettingsServiceFactory::SupervisedUserSettingsServiceFactory()
26 : BrowserContextKeyedServiceFactory( 26 : BrowserContextKeyedServiceFactory(
27 "SupervisedUserSettingsService", 27 "SupervisedUserSettingsService",
28 BrowserContextDependencyManager::GetInstance()) { 28 BrowserContextDependencyManager::GetInstance()) {
29 } 29 }
30 30
31 SupervisedUserSettingsServiceFactory:: 31 SupervisedUserSettingsServiceFactory::
32 ~SupervisedUserSettingsServiceFactory() {} 32 ~SupervisedUserSettingsServiceFactory() {}
33 33
34 KeyedService* SupervisedUserSettingsServiceFactory::BuildServiceInstanceFor( 34 KeyedService* SupervisedUserSettingsServiceFactory::BuildServiceInstanceFor(
35 content::BrowserContext* profile) const { 35 content::BrowserContext* profile) const {
36 return new SupervisedUserSettingsService( 36 return new SupervisedUserSettingsService(
37 Profile::FromBrowserContext(profile)); 37 Profile::FromBrowserContext(profile));
38 } 38 }
39 39
40 content::BrowserContext* 40 content::BrowserContext*
41 SupervisedUserSettingsServiceFactory::GetBrowserContextToUse( 41 SupervisedUserSettingsServiceFactory::GetBrowserContextToUse(
42 content::BrowserContext* context) const { 42 content::BrowserContext* context) const {
43 return chrome::GetBrowserContextRedirectedInIncognito(context); 43 return chrome::GetBrowserContextRedirectedInIncognito(context);
44 } 44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698