| 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() {}
|
|
|