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

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

Issue 33173005: Correctly deal with tokens for supervised users in ProfileOAuth2TokenService. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 7 years, 1 month 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/account_tracker.cc
diff --git a/chrome/browser/extensions/api/identity/account_tracker.cc b/chrome/browser/extensions/api/identity/account_tracker.cc
index ea09479bd4193855630b4b7a848488f7af900334..f046ff5f4e004593c1eae9a69ef196f08273edca 100644
--- a/chrome/browser/extensions/api/identity/account_tracker.cc
+++ b/chrome/browser/extensions/api/identity/account_tracker.cc
@@ -51,6 +51,12 @@ void AccountTracker::RemoveObserver(Observer* observer) {
}
void AccountTracker::OnRefreshTokenAvailable(const std::string& account_id) {
+ // Ignore refresh tokens if there is no primary account ID at all.
+ ProfileOAuth2TokenService* token_service =
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile_);
+ if (token_service->GetPrimaryAccountId().empty())
+ return;
+
DVLOG(1) << "AVAILABLE " << account_id;
ClearAuthError(account_id);
UpdateSignInState(account_id, true);

Powered by Google App Engine
This is Rietveld 408576698