Chromium Code Reviews| Index: chrome/browser/signin/signin_manager.cc |
| diff --git a/chrome/browser/signin/signin_manager.cc b/chrome/browser/signin/signin_manager.cc |
| index 24fbd35446fa83ad1d51b5c0953c87202dee94f6..54aa4215b38d92896719787c9d14fdf61dab369a 100644 |
| --- a/chrome/browser/signin/signin_manager.cc |
| +++ b/chrome/browser/signin/signin_manager.cc |
| @@ -130,9 +130,15 @@ void SigninManager::Initialize(Profile* profile) { |
| TokenService* token_service = TokenServiceFactory::GetForProfile(profile_); |
| if (token_service) { |
| token_service->Initialize(GaiaConstants::kChromeSource, profile_); |
| + // ChromeOS will kick off TokenService::LoadTokensFromDB from |
| + // OAuthLoginManager once the rest of the Profile is fully initialized. |
| + // Starting it from here would cause OAuthLoginManager mismatch the origin |
| + // of OAuth2 tokens. |
| +#if !defined(OS_CHROMEOS) |
|
tim (not reviewing)
2013/01/15 02:36:34
fwiw, we've been trying to get rid of ifdefs like
|
| if (!authenticated_username_.empty()) { |
| token_service->LoadTokensFromDB(); |
| } |
| +#endif |
| } |
| if (!user.empty() && !IsAllowedUsername(user)) { |
| // User is signed in, but the username is invalid - the administrator must |
| @@ -554,7 +560,7 @@ void SigninManager::OnGetUserInfoSuccess(const UserInfoMap& data) { |
| // If we have oauth2 tokens, tell token service about them so it does not |
| // need to fetch them again. |
| if (!temp_oauth_login_tokens_.refresh_token.empty()) { |
| - token_service->OnClientOAuthSuccess(temp_oauth_login_tokens_); |
| + token_service->UpdateCredentialsWithOAuth2(temp_oauth_login_tokens_); |
| temp_oauth_login_tokens_ = ClientOAuthResult(); |
| } |
| } |