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