| Index: chrome/browser/extensions/api/identity/identity_api.cc
|
| diff --git a/chrome/browser/extensions/api/identity/identity_api.cc b/chrome/browser/extensions/api/identity/identity_api.cc
|
| index 128fb6ed190b141be5030cd28621168fd23b13e3..3cd72e54d646842fe7409224306b8c3c0f62d01c 100644
|
| --- a/chrome/browser/extensions/api/identity/identity_api.cc
|
| +++ b/chrome/browser/extensions/api/identity/identity_api.cc
|
| @@ -220,9 +220,12 @@ void IdentityGetAuthTokenFunction::StartMintToken(
|
| IsEnterpriseManaged()) {
|
| OAuth2TokenService::ScopeSet scope_set(oauth2_info.scopes.begin(),
|
| oauth2_info.scopes.end());
|
| + chromeos::DeviceOAuth2TokenService* token_service =
|
| + chromeos::DeviceOAuth2TokenServiceFactory::Get();
|
| device_token_request_ =
|
| - chromeos::DeviceOAuth2TokenServiceFactory::Get()->StartRequest(
|
| - scope_set, this);
|
| + token_service->StartRequest(token_service->GetDeviceAccountId(),
|
| + scope_set,
|
| + this);
|
| } else {
|
| gaia_mint_token_mode_ = OAuth2MintTokenFlow::MODE_MINT_TOKEN_FORCE;
|
| StartLoginAccessTokenRequest();
|
| @@ -425,7 +428,8 @@ void IdentityGetAuthTokenFunction::StartLoginAccessTokenRequest() {
|
| if (chromeos::UserManager::Get()->GetAppModeChromeClientOAuthInfo(
|
| &app_client_id, &app_client_secret)) {
|
| login_token_request_ =
|
| - service->StartRequestForClient(app_client_id,
|
| + service->StartRequestForClient(std::string(),
|
| + app_client_id,
|
| app_client_secret,
|
| OAuth2TokenService::ScopeSet(),
|
| this);
|
| @@ -433,8 +437,8 @@ void IdentityGetAuthTokenFunction::StartLoginAccessTokenRequest() {
|
| }
|
| }
|
| #endif
|
| - login_token_request_ = service->StartRequest(OAuth2TokenService::ScopeSet(),
|
| - this);
|
| + login_token_request_ = service->StartRequest(
|
| + service->GetPrimaryAccountId(), OAuth2TokenService::ScopeSet(), this);
|
| }
|
|
|
| void IdentityGetAuthTokenFunction::StartGaiaRequest(
|
| @@ -478,8 +482,10 @@ OAuth2MintTokenFlow* IdentityGetAuthTokenFunction::CreateMintTokenFlow(
|
| }
|
|
|
| bool IdentityGetAuthTokenFunction::HasLoginToken() const {
|
| - return ProfileOAuth2TokenServiceFactory::GetForProfile(profile())->
|
| - RefreshTokenIsAvailable();
|
| + ProfileOAuth2TokenService* token_service =
|
| + ProfileOAuth2TokenServiceFactory::GetForProfile(profile());
|
| + return token_service->RefreshTokenIsAvailable(
|
| + token_service->GetPrimaryAccountId());
|
| }
|
|
|
| std::string IdentityGetAuthTokenFunction::MapOAuth2ErrorToDescription(
|
|
|