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

Unified Diff: chrome/browser/extensions/api/identity/experimental_identity_api.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: Fixing a bug affecting ProfileSyncService and CR comments. 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/extensions/api/identity/experimental_identity_api.cc
diff --git a/chrome/browser/extensions/api/identity/experimental_identity_api.cc b/chrome/browser/extensions/api/identity/experimental_identity_api.cc
index 11e24081ab2160ab41c95aac8b8272919e31259a..f71b9acfd699181d98d0f83b854317add1806412 100644
--- a/chrome/browser/extensions/api/identity/experimental_identity_api.cc
+++ b/chrome/browser/extensions/api/identity/experimental_identity_api.cc
@@ -236,7 +236,8 @@ void ExperimentalIdentityGetAuthTokenFunction::StartLoginAccessTokenRequest() {
if (chromeos::UserManager::Get()->GetAppModeChromeClientOAuthInfo(
&app_client_id, &app_client_secret)) {
login_token_request_ =
- service->StartRequestForClient(app_client_id,
+ service->StartRequestForClient(service->GetPrimaryAccountId(),
+ app_client_id,
app_client_secret,
OAuth2TokenService::ScopeSet(),
this);
@@ -244,8 +245,8 @@ void ExperimentalIdentityGetAuthTokenFunction::StartLoginAccessTokenRequest() {
}
}
#endif
- login_token_request_ = service->StartRequest(OAuth2TokenService::ScopeSet(),
- this);
+ login_token_request_ = service->StartRequest(
+ service->GetPrimaryAccountId(), OAuth2TokenService::ScopeSet(), this);
}
void ExperimentalIdentityGetAuthTokenFunction::StartGaiaRequest(
@@ -289,8 +290,10 @@ ExperimentalIdentityGetAuthTokenFunction::CreateMintTokenFlow(
}
bool ExperimentalIdentityGetAuthTokenFunction::HasLoginToken() const {
- return ProfileOAuth2TokenServiceFactory::GetForProfile(profile())->
- RefreshTokenIsAvailable();
+ ProfileOAuth2TokenService* token_service =
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile());
+ return token_service->RefreshTokenIsAvailable(
+ token_service->GetPrimaryAccountId());
}
ExperimentalIdentityLaunchWebAuthFlowFunction::

Powered by Google App Engine
This is Rietveld 408576698