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

Side by Side Diff: chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_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/legacy/supervised_user_pref_mapping_ser vice_factory.h" 5 #include "chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_ser vice_factory.h"
6 6
7 #include "chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_ser vice.h" 7 #include "chrome/browser/supervised_user/legacy/supervised_user_pref_mapping_ser vice.h"
8 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_ service_factory.h" 8 #include "chrome/browser/supervised_user/legacy/supervised_user_shared_settings_ service_factory.h"
9 #include "components/keyed_service/content/browser_context_dependency_manager.h" 9 #include "components/keyed_service/content/browser_context_dependency_manager.h"
10 #include "components/user_prefs/user_prefs.h" 10 #include "components/user_prefs/user_prefs.h"
11 #include "content/public/browser/browser_context.h" 11 #include "content/public/browser/browser_context.h"
12 12
13 // static 13 // static
14 SupervisedUserPrefMappingService* 14 SupervisedUserPrefMappingService*
15 SupervisedUserPrefMappingServiceFactory::GetForBrowserContext( 15 SupervisedUserPrefMappingServiceFactory::GetForBrowserContext(
16 content::BrowserContext* profile) { 16 content::BrowserContext* profile) {
17 return static_cast<SupervisedUserPrefMappingService*>( 17 return static_cast<SupervisedUserPrefMappingService*>(
18 GetInstance()->GetServiceForBrowserContext(profile, true)); 18 GetInstance()->GetServiceForBrowserContext(profile, true));
19 } 19 }
20 20
21 // static 21 // static
22 SupervisedUserPrefMappingServiceFactory* 22 SupervisedUserPrefMappingServiceFactory*
23 SupervisedUserPrefMappingServiceFactory::GetInstance() { 23 SupervisedUserPrefMappingServiceFactory::GetInstance() {
24 return Singleton<SupervisedUserPrefMappingServiceFactory>::get(); 24 return base::Singleton<SupervisedUserPrefMappingServiceFactory>::get();
25 } 25 }
26 26
27 SupervisedUserPrefMappingServiceFactory:: 27 SupervisedUserPrefMappingServiceFactory::
28 SupervisedUserPrefMappingServiceFactory() 28 SupervisedUserPrefMappingServiceFactory()
29 : BrowserContextKeyedServiceFactory( 29 : BrowserContextKeyedServiceFactory(
30 "SupervisedUserPrefMappingService", 30 "SupervisedUserPrefMappingService",
31 BrowserContextDependencyManager::GetInstance()) { 31 BrowserContextDependencyManager::GetInstance()) {
32 DependsOn(SupervisedUserSharedSettingsServiceFactory::GetInstance()); 32 DependsOn(SupervisedUserSharedSettingsServiceFactory::GetInstance());
33 } 33 }
34 34
35 SupervisedUserPrefMappingServiceFactory:: 35 SupervisedUserPrefMappingServiceFactory::
36 ~SupervisedUserPrefMappingServiceFactory() {} 36 ~SupervisedUserPrefMappingServiceFactory() {}
37 37
38 KeyedService* SupervisedUserPrefMappingServiceFactory::BuildServiceInstanceFor( 38 KeyedService* SupervisedUserPrefMappingServiceFactory::BuildServiceInstanceFor(
39 content::BrowserContext* profile) const { 39 content::BrowserContext* profile) const {
40 return new SupervisedUserPrefMappingService( 40 return new SupervisedUserPrefMappingService(
41 user_prefs::UserPrefs::Get(profile), 41 user_prefs::UserPrefs::Get(profile),
42 SupervisedUserSharedSettingsServiceFactory::GetForBrowserContext( 42 SupervisedUserSharedSettingsServiceFactory::GetForBrowserContext(
43 profile)); 43 profile));
44 } 44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698