OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/sync/profile_sync_service.h" | 5 #include "chrome/browser/sync/profile_sync_service.h" |
6 | 6 |
7 #include <cstddef> | 7 #include <cstddef> |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <utility> | 10 #include <utility> |
(...skipping 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 const GoogleServiceAuthError auth_error = | 977 const GoogleServiceAuthError auth_error = |
978 ConnectionStatusToAuthError(status); | 978 ConnectionStatusToAuthError(status); |
979 DVLOG(1) << "Connection status change: " << auth_error.ToString(); | 979 DVLOG(1) << "Connection status change: " << auth_error.ToString(); |
980 UpdateAuthErrorState(auth_error); | 980 UpdateAuthErrorState(auth_error); |
981 } | 981 } |
982 | 982 |
983 void ProfileSyncService::OnStopSyncingPermanently() { | 983 void ProfileSyncService::OnStopSyncingPermanently() { |
984 UpdateAuthErrorState(AuthError(AuthError::SERVICE_UNAVAILABLE)); | 984 UpdateAuthErrorState(AuthError(AuthError::SERVICE_UNAVAILABLE)); |
985 sync_prefs_.SetStartSuppressed(true); | 985 sync_prefs_.SetStartSuppressed(true); |
986 DisableForUser(); | 986 DisableForUser(); |
| 987 // If signout is allowed, signout the user on a dashboard clear. |
| 988 if (!auto_start_enabled_) // Skip signout on ChromeOS/Android. |
| 989 signin_->SignOut(); |
987 } | 990 } |
988 | 991 |
989 void ProfileSyncService::OnPassphraseRequired( | 992 void ProfileSyncService::OnPassphraseRequired( |
990 syncer::PassphraseRequiredReason reason, | 993 syncer::PassphraseRequiredReason reason, |
991 const sync_pb::EncryptedData& pending_keys) { | 994 const sync_pb::EncryptedData& pending_keys) { |
992 DCHECK(backend_.get()); | 995 DCHECK(backend_.get()); |
993 DCHECK(backend_->IsNigoriEnabled()); | 996 DCHECK(backend_->IsNigoriEnabled()); |
994 | 997 |
995 // TODO(lipalani) : add this check to other locations as well. | 998 // TODO(lipalani) : add this check to other locations as well. |
996 if (HasUnrecoverableError()) { | 999 if (HasUnrecoverableError()) { |
(...skipping 977 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1974 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. | 1977 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. |
1975 ProfileSyncService* old_this = this; | 1978 ProfileSyncService* old_this = this; |
1976 this->~ProfileSyncService(); | 1979 this->~ProfileSyncService(); |
1977 new(old_this) ProfileSyncService( | 1980 new(old_this) ProfileSyncService( |
1978 new ProfileSyncComponentsFactoryImpl(profile, | 1981 new ProfileSyncComponentsFactoryImpl(profile, |
1979 CommandLine::ForCurrentProcess()), | 1982 CommandLine::ForCurrentProcess()), |
1980 profile, | 1983 profile, |
1981 signin, | 1984 signin, |
1982 behavior); | 1985 behavior); |
1983 } | 1986 } |
OLD | NEW |