OLD | NEW |
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/custodian_profile_downloader_ser
vice_factory.h" | 5 #include "chrome/browser/supervised_user/legacy/custodian_profile_downloader_ser
vice_factory.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" | 8 #include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
9 #include "chrome/browser/signin/signin_manager_factory.h" | 9 #include "chrome/browser/signin/signin_manager_factory.h" |
10 #include "chrome/browser/supervised_user/legacy/custodian_profile_downloader_ser
vice.h" | 10 #include "chrome/browser/supervised_user/legacy/custodian_profile_downloader_ser
vice.h" |
11 #include "components/keyed_service/content/browser_context_dependency_manager.h" | 11 #include "components/keyed_service/content/browser_context_dependency_manager.h" |
12 | 12 |
13 // static | 13 // static |
14 CustodianProfileDownloaderService* | 14 CustodianProfileDownloaderService* |
15 CustodianProfileDownloaderServiceFactory::GetForProfile( | 15 CustodianProfileDownloaderServiceFactory::GetForProfile( |
16 Profile* profile) { | 16 Profile* profile) { |
17 return static_cast<CustodianProfileDownloaderService*>( | 17 return static_cast<CustodianProfileDownloaderService*>( |
18 GetInstance()->GetServiceForBrowserContext(profile, true)); | 18 GetInstance()->GetServiceForBrowserContext(profile, true)); |
19 } | 19 } |
20 | 20 |
21 // static | 21 // static |
22 CustodianProfileDownloaderServiceFactory* | 22 CustodianProfileDownloaderServiceFactory* |
23 CustodianProfileDownloaderServiceFactory::GetInstance() { | 23 CustodianProfileDownloaderServiceFactory::GetInstance() { |
24 return Singleton<CustodianProfileDownloaderServiceFactory>::get(); | 24 return base::Singleton<CustodianProfileDownloaderServiceFactory>::get(); |
25 } | 25 } |
26 | 26 |
27 CustodianProfileDownloaderServiceFactory:: | 27 CustodianProfileDownloaderServiceFactory:: |
28 CustodianProfileDownloaderServiceFactory() | 28 CustodianProfileDownloaderServiceFactory() |
29 : BrowserContextKeyedServiceFactory( | 29 : BrowserContextKeyedServiceFactory( |
30 "CustodianProfileDownloaderService", | 30 "CustodianProfileDownloaderService", |
31 BrowserContextDependencyManager::GetInstance()) { | 31 BrowserContextDependencyManager::GetInstance()) { |
32 // Indirect dependency via ProfileDownloader. | 32 // Indirect dependency via ProfileDownloader. |
33 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); | 33 DependsOn(ProfileOAuth2TokenServiceFactory::GetInstance()); |
34 DependsOn(SigninManagerFactory::GetInstance()); | 34 DependsOn(SigninManagerFactory::GetInstance()); |
35 } | 35 } |
36 | 36 |
37 CustodianProfileDownloaderServiceFactory:: | 37 CustodianProfileDownloaderServiceFactory:: |
38 ~CustodianProfileDownloaderServiceFactory() {} | 38 ~CustodianProfileDownloaderServiceFactory() {} |
39 | 39 |
40 KeyedService* CustodianProfileDownloaderServiceFactory::BuildServiceInstanceFor( | 40 KeyedService* CustodianProfileDownloaderServiceFactory::BuildServiceInstanceFor( |
41 content::BrowserContext* profile) const { | 41 content::BrowserContext* profile) const { |
42 return new CustodianProfileDownloaderService(static_cast<Profile*>(profile)); | 42 return new CustodianProfileDownloaderService(static_cast<Profile*>(profile)); |
43 } | 43 } |
44 | 44 |
OLD | NEW |