Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3218)

Unified Diff: chrome/browser/signin/profile_oauth2_token_service_factory.cc

Issue 1143323005: Refactor AO2TS to make it easier to componentize. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address final comments Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/signin/profile_oauth2_token_service_factory.cc
diff --git a/chrome/browser/signin/profile_oauth2_token_service_factory.cc b/chrome/browser/signin/profile_oauth2_token_service_factory.cc
index 240bc9593428c0f04084866d925e1eae2829582b..ac1e849c8d2a7839f35ea3adb8312b32b5c1e492 100644
--- a/chrome/browser/signin/profile_oauth2_token_service_factory.cc
+++ b/chrome/browser/signin/profile_oauth2_token_service_factory.cc
@@ -13,9 +13,9 @@
#include "components/signin/core/browser/profile_oauth2_token_service.h"
#if defined(OS_ANDROID)
-#include "chrome/browser/signin/android_profile_oauth2_token_service.h"
+#include "chrome/browser/signin/oauth2_token_service_delegate_android.h"
#else
-#include "components/signin/core/browser/mutable_profile_oauth2_token_service.h"
+#include "chrome/browser/signin/mutable_profile_oauth2_token_service_delegate.h"
#endif
ProfileOAuth2TokenServiceFactory::ProfileOAuth2TokenServiceFactory()
@@ -38,14 +38,6 @@ ProfileOAuth2TokenServiceFactory::GetForProfile(Profile* profile) {
}
// static
-ProfileOAuth2TokenServiceFactory::PlatformSpecificOAuth2TokenService*
-ProfileOAuth2TokenServiceFactory::GetPlatformSpecificForProfile(
- Profile* profile) {
- return static_cast<PlatformSpecificOAuth2TokenService*>(
- GetForProfile(profile));
-}
-
-// static
ProfileOAuth2TokenServiceFactory*
ProfileOAuth2TokenServiceFactory::GetInstance() {
return Singleton<ProfileOAuth2TokenServiceFactory>::get();
@@ -53,11 +45,17 @@ ProfileOAuth2TokenServiceFactory*
KeyedService* ProfileOAuth2TokenServiceFactory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
+#if defined(OS_ANDROID)
+ OAuth2TokenServiceDelegateAndroid* delegate =
+ new OAuth2TokenServiceDelegateAndroid();
+ delegate->Initialize();
+#else
Profile* profile = static_cast<Profile*>(context);
- PlatformSpecificOAuth2TokenService* service =
- new PlatformSpecificOAuth2TokenService();
- service->Initialize(
- ChromeSigninClientFactory::GetInstance()->GetForProfile(profile),
- SigninErrorControllerFactory::GetInstance()->GetForProfile(profile));
+ MutableProfileOAuth2TokenServiceDelegate* delegate =
+ new MutableProfileOAuth2TokenServiceDelegate(
+ ChromeSigninClientFactory::GetInstance()->GetForProfile(profile),
+ SigninErrorControllerFactory::GetInstance()->GetForProfile(profile));
+#endif
+ ProfileOAuth2TokenService* service = new ProfileOAuth2TokenService(delegate);
return service;
}
« no previous file with comments | « chrome/browser/signin/profile_oauth2_token_service_factory.h ('k') | chrome/browser/signin/signin_tracker_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698