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

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

Issue 418393003: Identity API: make sure account ID is set correctly after sign in (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 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 | « no previous file | chrome/browser/extensions/api/identity/identity_apitest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b18fe73b46ab524fddaa6a412ef27795931f5c86..3f469e812491442f2bae3385b5bd2b14589864c2 100644
--- a/chrome/browser/extensions/api/identity/identity_api.cc
+++ b/chrome/browser/extensions/api/identity/identity_api.cc
@@ -566,6 +566,12 @@ void IdentityGetAuthTokenFunction::OnIssueAdviceSuccess(
}
void IdentityGetAuthTokenFunction::SigninSuccess() {
+ // If there was no account associated this profile before the
+ // sign-in, we may not have an account_id in the token_key yet.
+ if (token_key_->account_id.empty()) {
+ token_key_->account_id = GetPrimaryAccountId(GetProfile());
+ }
+
StartMintTokenFlow(IdentityMintRequestQueue::MINT_TYPE_NONINTERACTIVE);
}
« no previous file with comments | « no previous file | chrome/browser/extensions/api/identity/identity_apitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698