OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/signin/oauth2_token_service_factory.h" |
| 6 |
| 7 #include "chrome/browser/profiles/profile_dependency_manager.h" |
| 8 #include "chrome/browser/signin/oauth2_token_service.h" |
| 9 #include "chrome/browser/signin/token_service_factory.h" |
| 10 |
| 11 OAuth2TokenServiceFactory::OAuth2TokenServiceFactory() |
| 12 : ProfileKeyedServiceFactory("OAuth2TokenService", |
| 13 ProfileDependencyManager::GetInstance()) { |
| 14 DependsOn(TokenServiceFactory::GetInstance()); |
| 15 } |
| 16 |
| 17 OAuth2TokenServiceFactory::~OAuth2TokenServiceFactory() { |
| 18 } |
| 19 |
| 20 // static |
| 21 OAuth2TokenService* OAuth2TokenServiceFactory::GetForProfile(Profile* profile) { |
| 22 return static_cast<OAuth2TokenService*>( |
| 23 GetInstance()->GetServiceForProfile(profile, true)); |
| 24 } |
| 25 |
| 26 // static |
| 27 OAuth2TokenServiceFactory* OAuth2TokenServiceFactory::GetInstance() { |
| 28 return Singleton<OAuth2TokenServiceFactory>::get(); |
| 29 } |
| 30 |
| 31 ProfileKeyedService* OAuth2TokenServiceFactory::BuildServiceInstanceFor( |
| 32 Profile* profile) const { |
| 33 OAuth2TokenService* service = new OAuth2TokenService(); |
| 34 service->Initialize(profile); |
| 35 return service; |
| 36 } |
OLD | NEW |