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

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

Issue 19567004: Convert SigninTracker to use OAuth2TokenService notifications (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebased Created 7 years, 3 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/signin_manager.cc
diff --git a/chrome/browser/signin/signin_manager.cc b/chrome/browser/signin/signin_manager.cc
index 119e68097cbaf4a05b51acf74fe1b74505d5ca5d..b71be71ac4d9b62cecac2f76697a1d4b58ce70cb 100644
--- a/chrome/browser/signin/signin_manager.cc
+++ b/chrome/browser/signin/signin_manager.cc
@@ -593,8 +593,12 @@ void SigninManager::CompletePendingSignin() {
token_service->StartFetchingTokens();
// If we have oauth2 tokens, tell token service about them so it does not
- // need to fetch them again.
+ // need to fetch them again. Its important that the authenticated name has
+ // already been set before sending the oauth2 token to the token service.
+ // Some token service listeners will query the authenticated name when they
+ // receive the token available notification.
if (!temp_oauth_login_tokens_.refresh_token.empty()) {
+ DCHECK(!GetAuthenticatedUsername().empty());
token_service->UpdateCredentialsWithOAuth2(temp_oauth_login_tokens_);
temp_oauth_login_tokens_ = ClientOAuthResult();
}

Powered by Google App Engine
This is Rietveld 408576698