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

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: chromeos Created 7 years, 2 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/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())
Michael Courage 2013/10/29 18:25:35 This code doesn't give the reader much hope of und
Bernhard Bauer 2013/10/29 20:25:08 Roger can explain more about the ongoing refactori
Michael Courage 2013/10/29 21:13:47 I suspect that this layering violation is already
Bernhard Bauer 2013/10/30 16:23:23 No, this token should only be used by services tha
+ return;
+
DVLOG(1) << "AVAILABLE " << account_id;
ClearAuthError(account_id);
UpdateSignInState(account_id, true);

Powered by Google App Engine
This is Rietveld 408576698