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

Side by Side Diff: chrome/browser/sync/profile_sync_service.cc

Issue 14630003: signin: move SigninManagerBase::Signout to SigninManager. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 7 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after
1038 const GoogleServiceAuthError auth_error = 1038 const GoogleServiceAuthError auth_error =
1039 ConnectionStatusToAuthError(status); 1039 ConnectionStatusToAuthError(status);
1040 DVLOG(1) << "Connection status change: " << auth_error.ToString(); 1040 DVLOG(1) << "Connection status change: " << auth_error.ToString();
1041 UpdateAuthErrorState(auth_error); 1041 UpdateAuthErrorState(auth_error);
1042 } 1042 }
1043 1043
1044 void ProfileSyncService::OnStopSyncingPermanently() { 1044 void ProfileSyncService::OnStopSyncingPermanently() {
1045 UpdateAuthErrorState(AuthError(AuthError::SERVICE_UNAVAILABLE)); 1045 UpdateAuthErrorState(AuthError(AuthError::SERVICE_UNAVAILABLE));
1046 sync_prefs_.SetStartSuppressed(true); 1046 sync_prefs_.SetStartSuppressed(true);
1047 DisableForUser(); 1047 DisableForUser();
1048 // If signout is allowed, signout the user on a dashboard clear. 1048
1049 // Signout doesn't exist as a concept on Chrome OS. It currently does
1050 // on other auto-start platforms (like Android, though we should probably
1051 // use SigninManagerBase there as well), but we don't want to sign the
1052 // user out on auto-start platforms if sync was disabled.
1053 // TODO(tim): Platform specific refactoring here is bug 237866.
1054 #if !defined(OS_CHROMEOS)
1055 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_);
1056
1049 if (!auto_start_enabled_) // Skip signout on ChromeOS/Android. 1057 if (!auto_start_enabled_) // Skip signout on ChromeOS/Android.
1050 signin_->SignOut(); 1058 signin->SignOut();
1059 #endif
1051 } 1060 }
1052 1061
1053 void ProfileSyncService::OnPassphraseRequired( 1062 void ProfileSyncService::OnPassphraseRequired(
1054 syncer::PassphraseRequiredReason reason, 1063 syncer::PassphraseRequiredReason reason,
1055 const sync_pb::EncryptedData& pending_keys) { 1064 const sync_pb::EncryptedData& pending_keys) {
1056 DCHECK(backend_.get()); 1065 DCHECK(backend_.get());
1057 DCHECK(backend_->IsNigoriEnabled()); 1066 DCHECK(backend_->IsNigoriEnabled());
1058 1067
1059 // TODO(lipalani) : add this check to other locations as well. 1068 // TODO(lipalani) : add this check to other locations as well.
1060 if (HasUnrecoverableError()) { 1069 if (HasUnrecoverableError()) {
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
2064 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine d-behaviour-after-directly-calling-the-destru. 2073 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine d-behaviour-after-directly-calling-the-destru.
2065 ProfileSyncService* old_this = this; 2074 ProfileSyncService* old_this = this;
2066 this->~ProfileSyncService(); 2075 this->~ProfileSyncService();
2067 new(old_this) ProfileSyncService( 2076 new(old_this) ProfileSyncService(
2068 new ProfileSyncComponentsFactoryImpl(profile, 2077 new ProfileSyncComponentsFactoryImpl(profile,
2069 CommandLine::ForCurrentProcess()), 2078 CommandLine::ForCurrentProcess()),
2070 profile, 2079 profile,
2071 signin, 2080 signin,
2072 behavior); 2081 behavior);
2073 } 2082 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698