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

Unified Diff: chrome/browser/extensions/api/identity/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/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..620103a3fbeb06572f69b4c73a5a781eb1eb0a98 100644
--- a/chrome/browser/extensions/api/identity/identity_api.cc
+++ b/chrome/browser/extensions/api/identity/identity_api.cc
@@ -222,7 +222,7 @@ void IdentityGetAuthTokenFunction::StartMintToken(
oauth2_info.scopes.end());
device_token_request_ =
chromeos::DeviceOAuth2TokenServiceFactory::Get()->StartRequest(
- scope_set, this);
+ std::string(), scope_set, this);
Andrew T Wilson (Slow) 2013/08/30 10:47:00 See my previous comment about adding GetDeviceAcco
fgorski 2013/08/30 20:10:16 Done.
} else {
gaia_mint_token_mode_ = OAuth2MintTokenFlow::MODE_MINT_TOKEN_FORCE;
StartLoginAccessTokenRequest();
@@ -425,7 +425,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 +434,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 +479,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(

Powered by Google App Engine
This is Rietveld 408576698