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

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: Rebasing to include the update to ProfileSyncService: r224220 Created 7 years, 3 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 e4270dbc6ac1c0acd829b5599e4c61e5e1941d6c..8b4e9a0760383532cfde86f0394f2b1e97ed8463 100644
--- a/chrome/browser/profiles/profile_downloader.cc
+++ b/chrome/browser/profiles/profile_downloader.cc
@@ -217,7 +217,8 @@ void ProfileDownloader::Start() {
return;
}
- if (service->RefreshTokenIsAvailable()) {
+ if (service->RefreshTokenIsAvailable(
+ service->GetPrimaryAccountId())) {
StartFetchingOAuth2AccessToken();
} else {
service->AddObserver(this);
@@ -264,9 +265,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