OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/managed_mode/managed_user_registration_service_factory.
h" | 5 #include "chrome/browser/managed_mode/managed_user_registration_service_factory.
h" |
6 | 6 |
7 #include "chrome/browser/managed_mode/managed_user_registration_service.h" | 7 #include "chrome/browser/managed_mode/managed_user_registration_service.h" |
8 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 8 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
9 | 9 |
10 // static | 10 // static |
11 ManagedUserRegistrationService* | 11 ManagedUserRegistrationService* |
12 ManagedUserRegistrationServiceFactory::GetForProfile(Profile* profile) { | 12 ManagedUserRegistrationServiceFactory::GetForProfile(Profile* profile) { |
13 return static_cast<ManagedUserRegistrationService*>( | 13 return static_cast<ManagedUserRegistrationService*>( |
14 GetInstance()->GetServiceForProfile(profile, true)); | 14 GetInstance()->GetServiceForBrowserContext(profile, true)); |
15 } | 15 } |
16 | 16 |
17 // static | 17 // static |
18 ManagedUserRegistrationServiceFactory* | 18 ManagedUserRegistrationServiceFactory* |
19 ManagedUserRegistrationServiceFactory::GetInstance() { | 19 ManagedUserRegistrationServiceFactory::GetInstance() { |
20 return Singleton<ManagedUserRegistrationServiceFactory>::get(); | 20 return Singleton<ManagedUserRegistrationServiceFactory>::get(); |
21 } | 21 } |
22 | 22 |
23 // static | 23 // static |
24 ProfileKeyedService* ManagedUserRegistrationServiceFactory::BuildInstanceFor( | 24 BrowserContextKeyedService* |
25 Profile* profile) { | 25 ManagedUserRegistrationServiceFactory::BuildInstanceFor(Profile* profile) { |
26 return new ManagedUserRegistrationService(); | 26 return new ManagedUserRegistrationService(); |
27 } | 27 } |
28 | 28 |
29 ManagedUserRegistrationServiceFactory::ManagedUserRegistrationServiceFactory() | 29 ManagedUserRegistrationServiceFactory::ManagedUserRegistrationServiceFactory() |
30 : ProfileKeyedServiceFactory("ManagedUserRegistrationService", | 30 : BrowserContextKeyedServiceFactory( |
31 ProfileDependencyManager::GetInstance()) { | 31 "ManagedUserRegistrationService", |
| 32 BrowserContextDependencyManager::GetInstance()) { |
32 } | 33 } |
33 | 34 |
34 ManagedUserRegistrationServiceFactory:: | 35 ManagedUserRegistrationServiceFactory:: |
35 ~ManagedUserRegistrationServiceFactory() {} | 36 ~ManagedUserRegistrationServiceFactory() {} |
36 | 37 |
37 ProfileKeyedService* | 38 BrowserContextKeyedService* |
38 ManagedUserRegistrationServiceFactory::BuildServiceInstanceFor( | 39 ManagedUserRegistrationServiceFactory::BuildServiceInstanceFor( |
39 content::BrowserContext* profile) const { | 40 content::BrowserContext* profile) const { |
40 return BuildInstanceFor(static_cast<Profile*>(profile)); | 41 return BuildInstanceFor(static_cast<Profile*>(profile)); |
41 } | 42 } |
OLD | NEW |