Index: chrome/browser/signin/profile_oauth2_token_service_factory.cc |
diff --git a/chrome/browser/signin/oauth2_token_service_factory.cc b/chrome/browser/signin/profile_oauth2_token_service_factory.cc |
similarity index 38% |
rename from chrome/browser/signin/oauth2_token_service_factory.cc |
rename to chrome/browser/signin/profile_oauth2_token_service_factory.cc |
index c0ca0be9672ea065e22c8668b0f99f6d397645e9..f9fb6478b58b947fbb2f5f60961e0ba8d6b1e066 100644 |
--- a/chrome/browser/signin/oauth2_token_service_factory.cc |
+++ b/chrome/browser/signin/profile_oauth2_token_service_factory.cc |
@@ -2,37 +2,49 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#include "chrome/browser/signin/oauth2_token_service_factory.h" |
+#include "chrome/browser/signin/profile_oauth2_token_service_factory.h" |
+#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/profiles/profile_dependency_manager.h" |
-#include "chrome/browser/signin/oauth2_token_service.h" |
+#include "chrome/browser/signin/profile_oauth2_token_service.h" |
#include "chrome/browser/signin/signin_manager_factory.h" |
#include "chrome/browser/signin/token_service_factory.h" |
-OAuth2TokenServiceFactory::OAuth2TokenServiceFactory() |
- : ProfileKeyedServiceFactory("OAuth2TokenService", |
+#if defined(OS_ANDROID) |
+#include "chrome/browser/signin/android_profile_oauth2_token_service.h" |
+#endif |
+ |
+ProfileOAuth2TokenServiceFactory::ProfileOAuth2TokenServiceFactory() |
+ : ProfileKeyedServiceFactory("ProfileOAuth2TokenService", |
ProfileDependencyManager::GetInstance()) { |
DependsOn(SigninManagerFactory::GetInstance()); |
DependsOn(TokenServiceFactory::GetInstance()); |
} |
-OAuth2TokenServiceFactory::~OAuth2TokenServiceFactory() { |
+ProfileOAuth2TokenServiceFactory::~ProfileOAuth2TokenServiceFactory() { |
} |
// static |
-OAuth2TokenService* OAuth2TokenServiceFactory::GetForProfile(Profile* profile) { |
- return static_cast<OAuth2TokenService*>( |
+ProfileOAuth2TokenService* ProfileOAuth2TokenServiceFactory::GetForProfile( |
+ Profile* profile) { |
+ return static_cast<ProfileOAuth2TokenService*>( |
GetInstance()->GetServiceForProfile(profile, true)); |
} |
// static |
-OAuth2TokenServiceFactory* OAuth2TokenServiceFactory::GetInstance() { |
- return Singleton<OAuth2TokenServiceFactory>::get(); |
+ProfileOAuth2TokenServiceFactory* |
+ ProfileOAuth2TokenServiceFactory::GetInstance() { |
+ return Singleton<ProfileOAuth2TokenServiceFactory>::get(); |
} |
-ProfileKeyedService* OAuth2TokenServiceFactory::BuildServiceInstanceFor( |
+ProfileKeyedService* ProfileOAuth2TokenServiceFactory::BuildServiceInstanceFor( |
Profile* profile) const { |
- OAuth2TokenService* service = new OAuth2TokenService(); |
+ ProfileOAuth2TokenService* service; |
+#if defined(OS_ANDROID) |
+ service = new AndroidProfileOAuth2TokenService(profile->GetRequestContext()); |
+#else |
+ service = new ProfileOAuth2TokenService(profile->GetRequestContext()); |
+#endif |
service->Initialize(profile); |
return service; |
} |