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

Unified Diff: chrome/browser/profiles/profile_downloader.cc

Issue 23382008: Making OAuth2TokenService multi-login aware, updating callers, minor fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updates to AndroidPO2TS and removing the DCHECK(signin_manager) from GetPrimaryAccountId Created 7 years, 4 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/profiles/profile_downloader.cc
diff --git a/chrome/browser/profiles/profile_downloader.cc b/chrome/browser/profiles/profile_downloader.cc
index 08da574b808479a3afea1600ac7f2f5c87cda1da..79365c49fe383cf388d9ebbac731f3dc45bda7a7 100644
--- a/chrome/browser/profiles/profile_downloader.cc
+++ b/chrome/browser/profiles/profile_downloader.cc
@@ -209,7 +209,8 @@ void ProfileDownloader::Start() {
return;
}
- if (service->RefreshTokenIsAvailable()) {
+ if (service->RefreshTokenIsAvailable(
+ service->GetPrimaryAccountId())) {
StartFetchingOAuth2AccessToken();
} else {
service->AddObserver(this);
@@ -252,9 +253,10 @@ void ProfileDownloader::StartFetchingOAuth2AccessToken() {
Profile* profile = delegate_->GetBrowserProfile();
OAuth2TokenService::ScopeSet scopes;
scopes.insert(kAPIScope);
- oauth2_access_token_request_ =
- ProfileOAuth2TokenServiceFactory::GetForProfile(profile)
- ->StartRequestWithContext(profile->GetRequestContext(), scopes, this);
+ ProfileOAuth2TokenService* token_service =
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
+ oauth2_access_token_request_ = token_service->StartRequest(
+ token_service->GetPrimaryAccountId(), scopes, this);
}
ProfileDownloader::~ProfileDownloader() {}

Powered by Google App Engine
This is Rietveld 408576698