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

Unified Diff: chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc

Issue 293063002: Multiple account support in chrome.identity.getAuthToken (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: use full name of enable-new-profile-management Created 6 years, 6 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/gaia_web_auth_flow.cc
diff --git a/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc b/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc
index 5da652deff77b56026567687f82ee91e68763879..49d4d1e4eb1e738ffb5a9a59d7c6d2b7cb1f33b6 100644
--- a/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc
+++ b/chrome/browser/extensions/api/identity/gaia_web_auth_flow.cc
@@ -20,11 +20,11 @@ namespace extensions {
GaiaWebAuthFlow::GaiaWebAuthFlow(Delegate* delegate,
Profile* profile,
+ const std::string& account_id,
const std::string& extension_id,
const OAuth2Info& oauth2_info,
const std::string& locale)
- : delegate_(delegate),
- profile_(profile) {
+ : delegate_(delegate), profile_(profile), account_id_(account_id) {
const char kOAuth2RedirectPathFormat[] = "/%s#";
const char kOAuth2AuthorizeFormat[] =
"?response_type=token&approval_prompt=force&authuser=0&"
@@ -64,10 +64,7 @@ void GaiaWebAuthFlow::Start() {
ubertoken_fetcher_.reset(new UbertokenFetcher(token_service,
this,
profile_->GetRequestContext()));
- SigninManagerBase* signin_manager =
- SigninManagerFactory::GetForProfile(profile_);
- ubertoken_fetcher_->StartFetchingToken(
- signin_manager->GetAuthenticatedAccountId());
+ ubertoken_fetcher_->StartFetchingToken(account_id_);
}
void GaiaWebAuthFlow::OnUbertokenSuccess(const std::string& token) {
@@ -87,6 +84,7 @@ void GaiaWebAuthFlow::OnUbertokenSuccess(const std::string& token) {
}
void GaiaWebAuthFlow::OnUbertokenFailure(const GoogleServiceAuthError& error) {
+ DVLOG(1) << "OnUbertokenFailure: " << error.error_message();
delegate_->OnGaiaFlowFailure(
GaiaWebAuthFlow::SERVICE_AUTH_ERROR, error, std::string());
}
@@ -99,6 +97,7 @@ void GaiaWebAuthFlow::OnAuthFlowFailure(WebAuthFlow::Failure failure) {
gaia_failure = GaiaWebAuthFlow::WINDOW_CLOSED;
break;
case WebAuthFlow::LOAD_FAILED:
+ DVLOG(1) << "OnAuthFlowFailure LOAD_FAILED";
gaia_failure = GaiaWebAuthFlow::LOAD_FAILED;
break;
default:

Powered by Google App Engine
This is Rietveld 408576698