| 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/profile_oauth2_token_service_factory.h" | 5 #include "chrome/browser/signin/profile_oauth2_token_service_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.h" | 8 #include "chrome/browser/signin/profile_oauth2_token_service.h" |
| 9 #include "chrome/browser/signin/signin_manager_factory.h" |
| 9 #include "chrome/browser/signin/token_service_factory.h" | 10 #include "chrome/browser/signin/token_service_factory.h" |
| 10 #include "chrome/browser/ui/global_error/global_error_service_factory.h" | 11 #include "chrome/browser/ui/global_error/global_error_service_factory.h" |
| 11 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" | 12 #include "components/browser_context_keyed_service/browser_context_dependency_ma
nager.h" |
| 12 | 13 |
| 13 ProfileOAuth2TokenServiceFactory::ProfileOAuth2TokenServiceFactory() | 14 ProfileOAuth2TokenServiceFactory::ProfileOAuth2TokenServiceFactory() |
| 14 : BrowserContextKeyedServiceFactory( | 15 : BrowserContextKeyedServiceFactory( |
| 15 "ProfileOAuth2TokenService", | 16 "ProfileOAuth2TokenService", |
| 16 BrowserContextDependencyManager::GetInstance()) { | 17 BrowserContextDependencyManager::GetInstance()) { |
| 17 DependsOn(GlobalErrorServiceFactory::GetInstance()); | 18 DependsOn(GlobalErrorServiceFactory::GetInstance()); |
| 19 DependsOn(SigninManagerFactory::GetInstance()); |
| 18 DependsOn(TokenServiceFactory::GetInstance()); | 20 DependsOn(TokenServiceFactory::GetInstance()); |
| 19 } | 21 } |
| 20 | 22 |
| 21 ProfileOAuth2TokenServiceFactory::~ProfileOAuth2TokenServiceFactory() { | 23 ProfileOAuth2TokenServiceFactory::~ProfileOAuth2TokenServiceFactory() { |
| 22 } | 24 } |
| 23 | 25 |
| 24 #if defined(OS_ANDROID) | 26 #if defined(OS_ANDROID) |
| 25 // static | 27 // static |
| 26 AndroidProfileOAuth2TokenService* | 28 AndroidProfileOAuth2TokenService* |
| 27 ProfileOAuth2TokenServiceFactory::GetForProfile(Profile* profile) { | 29 ProfileOAuth2TokenServiceFactory::GetForProfile(Profile* profile) { |
| (...skipping 21 matching lines...) Expand all Loading... |
| 49 Profile* profile = static_cast<Profile*>(context); | 51 Profile* profile = static_cast<Profile*>(context); |
| 50 ProfileOAuth2TokenService* service; | 52 ProfileOAuth2TokenService* service; |
| 51 #if defined(OS_ANDROID) | 53 #if defined(OS_ANDROID) |
| 52 service = new AndroidProfileOAuth2TokenService(); | 54 service = new AndroidProfileOAuth2TokenService(); |
| 53 #else | 55 #else |
| 54 service = new ProfileOAuth2TokenService(); | 56 service = new ProfileOAuth2TokenService(); |
| 55 #endif | 57 #endif |
| 56 service->Initialize(profile); | 58 service->Initialize(profile); |
| 57 return service; | 59 return service; |
| 58 } | 60 } |
| OLD | NEW |