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

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: apocalypse 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 1062 matching lines...) Expand 10 before | Expand all | Expand 10 after
1073 const GoogleServiceAuthError auth_error = 1073 const GoogleServiceAuthError auth_error =
1074 ConnectionStatusToAuthError(status); 1074 ConnectionStatusToAuthError(status);
1075 DVLOG(1) << "Connection status change: " << auth_error.ToString(); 1075 DVLOG(1) << "Connection status change: " << auth_error.ToString();
1076 UpdateAuthErrorState(auth_error); 1076 UpdateAuthErrorState(auth_error);
1077 } 1077 }
1078 1078
1079 void ProfileSyncService::OnStopSyncingPermanently() { 1079 void ProfileSyncService::OnStopSyncingPermanently() {
1080 UpdateAuthErrorState(AuthError(AuthError::SERVICE_UNAVAILABLE)); 1080 UpdateAuthErrorState(AuthError(AuthError::SERVICE_UNAVAILABLE));
1081 sync_prefs_.SetStartSuppressed(true); 1081 sync_prefs_.SetStartSuppressed(true);
1082 DisableForUser(); 1082 DisableForUser();
1083 // If signout is allowed, signout the user on a dashboard clear. 1083
1084 // Signout doesn't exist as a concept on Chrome OS. It currently does
1085 // on other auto-start platforms (like Android, though we should probably
1086 // use SigninManagerBase there as well), but we don't want to sign the
1087 // user out on auto-start platforms if sync was disabled.
1088 // TODO(tim): Platform specific refactoring here is bug 237866.
1089 #if !defined(OS_CHROMEOS)
1090 SigninManager* signin = SigninManagerFactory::GetForProfile(profile_);
1091
1084 if (!auto_start_enabled_) // Skip signout on ChromeOS/Android. 1092 if (!auto_start_enabled_) // Skip signout on ChromeOS/Android.
1085 signin_->SignOut(); 1093 signin->SignOut();
1094 #endif
1086 } 1095 }
1087 1096
1088 void ProfileSyncService::OnPassphraseRequired( 1097 void ProfileSyncService::OnPassphraseRequired(
1089 syncer::PassphraseRequiredReason reason, 1098 syncer::PassphraseRequiredReason reason,
1090 const sync_pb::EncryptedData& pending_keys) { 1099 const sync_pb::EncryptedData& pending_keys) {
1091 DCHECK(backend_.get()); 1100 DCHECK(backend_.get());
1092 DCHECK(backend_->IsNigoriEnabled()); 1101 DCHECK(backend_->IsNigoriEnabled());
1093 1102
1094 // TODO(lipalani) : add this check to other locations as well. 1103 // TODO(lipalani) : add this check to other locations as well.
1095 if (HasUnrecoverableError()) { 1104 if (HasUnrecoverableError()) {
(...skipping 1003 matching lines...) Expand 10 before | Expand all | Expand 10 after
2099 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine d-behaviour-after-directly-calling-the-destru. 2108 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine d-behaviour-after-directly-calling-the-destru.
2100 ProfileSyncService* old_this = this; 2109 ProfileSyncService* old_this = this;
2101 this->~ProfileSyncService(); 2110 this->~ProfileSyncService();
2102 new(old_this) ProfileSyncService( 2111 new(old_this) ProfileSyncService(
2103 new ProfileSyncComponentsFactoryImpl(profile, 2112 new ProfileSyncComponentsFactoryImpl(profile,
2104 CommandLine::ForCurrentProcess()), 2113 CommandLine::ForCurrentProcess()),
2105 profile, 2114 profile,
2106 signin, 2115 signin,
2107 behavior); 2116 behavior);
2108 } 2117 }
OLDNEW
« no previous file with comments | « chrome/browser/signin/signin_tracker_unittest.cc ('k') | chrome/browser/sync/profile_sync_service_startup_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698