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

Unified Diff: chrome/browser/signin/profile_oauth2_token_service.cc

Issue 19567004: Convert SigninTracker to use OAuth2TokenService notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Filip's review 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/signin/profile_oauth2_token_service.cc
diff --git a/chrome/browser/signin/profile_oauth2_token_service.cc b/chrome/browser/signin/profile_oauth2_token_service.cc
index 1687b33ef6c8e637b13d75deb8c981d0331e215b..ecdba8bf008b694dafeaed44dcc2240b2a2326ee 100644
--- a/chrome/browser/signin/profile_oauth2_token_service.cc
+++ b/chrome/browser/signin/profile_oauth2_token_service.cc
@@ -122,6 +122,11 @@ void ProfileOAuth2TokenService::UpdateAuthError(
if (error.state() != last_auth_error_.state()) {
last_auth_error_ = error;
signin_global_error_->AuthStatusChanged();
+
+ if (last_auth_error_.state() ==
+ GoogleServiceAuthError::INVALID_GAIA_CREDENTIALS) {
+ RevokeCredentials(GetAccountId(profile_));
Andrew T Wilson (Slow) 2013/08/30 09:03:33 Still extremely nervous about this. Are you sure w
Roger Tawa OOO till Jul 10th 2013/08/30 15:55:40 Yeah, me too. Changed to no longe revoke and chec
+ }
}
}
@@ -244,6 +249,15 @@ void ProfileOAuth2TokenService::RevokeCredentials(
// TODO(fgorski): Notify diagnostic observers.
}
+
+ // Remove the token from TokenService if this corresponds to the connected
+ // account.
+ if (account_id == GetAccountId(profile_)) {
+ TokenService* token_service =
+ TokenServiceFactory::GetForProfile(profile_);
+ token_service->ClearOAuth2Credentials();
+ DCHECK(!token_service->HasOAuthLoginToken());
+ }
}
void ProfileOAuth2TokenService::RevokeAllCredentials() {

Powered by Google App Engine
This is Rietveld 408576698