Index: chrome/browser/sync/profile_sync_service.cc |
diff --git a/chrome/browser/sync/profile_sync_service.cc b/chrome/browser/sync/profile_sync_service.cc |
index b9aa6cb1373657645265bc348fc524b40082f6db..c7a17689b091e977c334c2e60adb27dfcaa86c01 100644 |
--- a/chrome/browser/sync/profile_sync_service.cc |
+++ b/chrome/browser/sync/profile_sync_service.cc |
@@ -731,6 +731,7 @@ void ProfileSyncService::ShutdownImpl(bool sync_disabled) { |
encrypt_everything_ = false; |
encrypted_types_ = syncer::SyncEncryptionHandler::SensitiveTypes(); |
passphrase_required_reason_ = syncer::REASON_PASSPHRASE_NOT_REQUIRED; |
+ start_up_time_ = base::Time(); |
// Revert to "no auth error". |
if (last_auth_error_.state() != GoogleServiceAuthError::NONE) |
UpdateAuthErrorState(GoogleServiceAuthError::AuthErrorNone()); |
@@ -1082,21 +1083,8 @@ void ProfileSyncService::OnConnectionStatusChange( |
} |
void ProfileSyncService::OnStopSyncingPermanently() { |
- UpdateAuthErrorState(AuthError(AuthError::SERVICE_UNAVAILABLE)); |
sync_prefs_.SetStartSuppressed(true); |
DisableForUser(); |
- |
- // Signout doesn't exist as a concept on Chrome OS. It currently does |
- // on other auto-start platforms (like Android, though we should probably |
- // use SigninManagerBase there as well), but we don't want to sign the |
- // user out on auto-start platforms if sync was disabled. |
- // TODO(tim): Platform specific refactoring here is bug 237866. |
-#if !defined(OS_CHROMEOS) |
- SigninManager* signin = SigninManagerFactory::GetForProfile(profile_); |
- |
- if (!auto_start_enabled_) // Skip signout on ChromeOS/Android. |
- signin->SignOut(); |
-#endif |
} |
void ProfileSyncService::OnPassphraseRequired( |
@@ -1221,6 +1209,8 @@ void ProfileSyncService::OnActionableError(const SyncProtocolError& error) { |
break; |
case syncer::DISABLE_SYNC_ON_CLIENT: |
OnStopSyncingPermanently(); |
+ // TODO(rsimha): Re-evaluate whether to also sign out the user here after |
+ // a dashboard clear. See http://crbug.com/240436. |
break; |
default: |
NOTREACHED(); |
@@ -1927,9 +1917,13 @@ void ProfileSyncService::Observe(int type, |
#if defined(OS_CHROMEOS) |
RefreshSpareBootstrapToken(successful->password); |
#endif |
- if (!sync_initialized() || |
- GetAuthError().state() != AuthError::NONE) { |
+ if (!sync_initialized() && GetAuthError().state() != AuthError::NONE) { |
Andrew T Wilson (Slow)
2013/05/15 15:01:24
This doesn't seem like the right change - we want
Raghu Simha
2013/05/16 02:13:20
I had orignally changed this logic to handle the c
|
// Track the fact that we're still waiting for auth to complete. |
+ // Note: We mustn't set |is_auth_in_progress_| to true when the backend |
+ // is already initialized because it's possible to end up here when a |
+ // signed in user with sync disabled changes their gaia password, and |
+ // then re-auths while trying to re-enable sync. In such a case, auth |
+ // is complete when we receive NOTIFICATION_GOOGLE_SIGNIN_SUCCESSFUL. |
is_auth_in_progress_ = true; |
} |
break; |