OLD | NEW |
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/signin/token_service_factory.h" | 5 #include "chrome/browser/signin/token_service_factory.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile_dependency_manager.h" | 7 #include "chrome/browser/profiles/profile_dependency_manager.h" |
8 #include "chrome/browser/signin/token_service.h" | 8 #include "chrome/browser/signin/token_service.h" |
| 9 #include "chrome/browser/webdata/web_data_service_factory.h" |
9 | 10 |
10 TokenServiceFactory::TokenServiceFactory() | 11 TokenServiceFactory::TokenServiceFactory() |
11 : ProfileKeyedServiceFactory("TokenService", | 12 : ProfileKeyedServiceFactory("TokenService", |
12 ProfileDependencyManager::GetInstance()) { | 13 ProfileDependencyManager::GetInstance()) { |
13 // TODO(rlp): TokenService depends on WebDataService - when this is | 14 DependsOn(WebDataServiceFactory::GetInstance()); |
14 // converted to the ProfileKeyedService framework, uncomment this dependency. | |
15 // DependsOn(WebDataServiceFactory::GetInstance()); | |
16 } | 15 } |
17 | 16 |
18 TokenServiceFactory::~TokenServiceFactory() {} | 17 TokenServiceFactory::~TokenServiceFactory() {} |
19 | 18 |
20 // static | 19 // static |
21 TokenService* TokenServiceFactory::GetForProfile(Profile* profile) { | 20 TokenService* TokenServiceFactory::GetForProfile(Profile* profile) { |
22 return static_cast<TokenService*>( | 21 return static_cast<TokenService*>( |
23 GetInstance()->GetServiceForProfile(profile, true)); | 22 GetInstance()->GetServiceForProfile(profile, true)); |
24 } | 23 } |
25 | 24 |
26 // static | 25 // static |
27 TokenServiceFactory* TokenServiceFactory::GetInstance() { | 26 TokenServiceFactory* TokenServiceFactory::GetInstance() { |
28 return Singleton<TokenServiceFactory>::get(); | 27 return Singleton<TokenServiceFactory>::get(); |
29 } | 28 } |
30 | 29 |
31 ProfileKeyedService* TokenServiceFactory::BuildServiceInstanceFor( | 30 ProfileKeyedService* TokenServiceFactory::BuildServiceInstanceFor( |
32 Profile* profile) const { | 31 Profile* profile) const { |
33 return new TokenService(); | 32 return new TokenService(); |
34 } | 33 } |
OLD | NEW |