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

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: 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
« no previous file with comments | « chrome/browser/drive/gdata_wapi_service.cc ('k') | chrome/browser/extensions/api/identity/identity_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 4920f55dcb563446432f8a03a9116f3f66091b22..5839991f2d1da8b50b4ad0c92e30de944d135f80 100644
--- a/chrome/browser/extensions/api/identity/experimental_identity_api.cc
+++ b/chrome/browser/extensions/api/identity/experimental_identity_api.cc
@@ -235,7 +235,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);
@@ -243,8 +244,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(
@@ -288,8 +289,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::
« no previous file with comments | « chrome/browser/drive/gdata_wapi_service.cc ('k') | chrome/browser/extensions/api/identity/identity_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698