Chromium Code Reviews| Index: chrome/browser/sync/signin_manager.cc |
| diff --git a/chrome/browser/sync/signin_manager.cc b/chrome/browser/sync/signin_manager.cc |
| index ca5be0ce97812aaf65d46fc7e85921a3fce185d5..b24b949c7ac9b6f4fcd05c2109fdebccba932476 100644 |
| --- a/chrome/browser/sync/signin_manager.cc |
| +++ b/chrome/browser/sync/signin_manager.cc |
| @@ -80,12 +80,6 @@ void SigninManager::SetUsername(const std::string& username) { |
| void SigninManager::PrepareForSignin() { |
| DCHECK(!browser_sync::IsUsingOAuth()); |
| DCHECK(username_.empty()); |
| -#if !defined(OS_CHROMEOS) |
| - // The Sign out should clear the token service credentials. |
| - // Note: In CHROMEOS we might have valid credentials but still need to |
| - // set up 2-factor authentication. |
| - DCHECK(!profile_->GetTokenService()->AreCredentialsValid()); |
| -#endif |
| } |
| // static |
| @@ -160,18 +154,26 @@ void SigninManager::ProvideSecondFactorAccessCode( |
| GaiaAuthFetcher::HostedAccountsNotAllowed); |
| } |
| -void SigninManager::SignOut() { |
| +void SigninManager::ClearInMemoryData() { |
| if (!profile_) |
| return; |
| CleanupNotificationRegistration(); |
| - |
| client_login_.reset(); |
| last_result_ = ClientLoginResult(); |
| username_.clear(); |
| oauth_username_.clear(); |
| password_.clear(); |
| had_two_factor_error_ = false; |
| +} |
| + |
| +void SigninManager::SignOut() { |
| + if (!profile_) |
| + return; |
| + |
| + CleanupNotificationRegistration(); |
|
Nicolas Zea
2011/11/11 19:24:47
you can get rid of this call.
lipalani1
2011/11/11 19:38:31
Done.
|
| + |
| + ClearInMemoryData(); |
| profile_->GetPrefs()->ClearPref(prefs::kGoogleServicesUsername); |
| profile_->GetPrefs()->ClearPref(prefs::kSyncUsingOAuth); |
| profile_->GetPrefs()->ScheduleSavePersistentPrefs(); |
| @@ -251,7 +253,7 @@ void SigninManager::OnClientLoginFailure(const GoogleServiceAuthError& error) { |
| return; |
| } |
| - SignOut(); |
| + ClearInMemoryData(); |
| } |
| void SigninManager::OnOAuthGetAccessTokenSuccess(const std::string& token, |