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

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: Addressing CR 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/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..db557daf21de67a84489d8faa82745b356e7393a 100644
--- a/chrome/browser/ui/auto_login_prompter.cc
+++ b/chrome/browser/ui/auto_login_prompter.cc
@@ -31,16 +31,17 @@ 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;
Roger Tawa OOO till Jul 10th 2013/08/26 21:04:53 Need { and } since condition spans more than one l
fgorski 2013/08/26 23:30:54 Done.
+
*output = signin_manager->GetAuthenticatedUsername();
return true;
}

Powered by Google App Engine
This is Rietveld 408576698