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

Unified Diff: chrome/browser/ui/auto_login_prompter.cc

Issue 23382008: Making OAuth2TokenService multi-login aware, updating callers, minor fixes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebasing to include the update to ProfileSyncService: r224220 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/ui/auto_login_prompter.cc
diff --git a/chrome/browser/ui/auto_login_prompter.cc b/chrome/browser/ui/auto_login_prompter.cc
index 9d9bff0c2c683bee7668e119e510d0f256dc0121..70311db135a30bb0a1e14e8b28d85fdb178282fd 100644
--- a/chrome/browser/ui/auto_login_prompter.cc
+++ b/chrome/browser/ui/auto_login_prompter.cc
@@ -31,16 +31,18 @@ namespace {
bool FetchUsernameThroughSigninManager(Profile* profile, std::string* output) {
// In an incognito window these services are not available.
- ProfileOAuth2TokenService* token_service =
- ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
- if (!token_service || !token_service->RefreshTokenIsAvailable())
- return false;
-
SigninManagerBase* signin_manager =
SigninManagerFactory::GetInstance()->GetForProfile(profile);
if (!signin_manager)
return false;
+ ProfileOAuth2TokenService* token_service =
+ ProfileOAuth2TokenServiceFactory::GetForProfile(profile);
+ if (!token_service || !token_service->RefreshTokenIsAvailable(
+ token_service->GetPrimaryAccountId())) {
+ return false;
+ }
+
*output = signin_manager->GetAuthenticatedUsername();
return true;
}

Powered by Google App Engine
This is Rietveld 408576698