| 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 513 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 void ProfileSyncService::DisableForUser() { | 524 void ProfileSyncService::DisableForUser() { |
| 525 // Clear prefs (including SyncSetupHasCompleted) before shutting down so | 525 // Clear prefs (including SyncSetupHasCompleted) before shutting down so |
| 526 // PSS clients don't think we're set up while we're shutting down. | 526 // PSS clients don't think we're set up while we're shutting down. |
| 527 sync_prefs_.ClearPreferences(); | 527 sync_prefs_.ClearPreferences(); |
| 528 ClearUnrecoverableError(); | 528 ClearUnrecoverableError(); |
| 529 ShutdownImpl(true); | 529 ShutdownImpl(true); |
| 530 | 530 |
| 531 // TODO(atwilson): Don't call SignOut() on *any* platform - move this into | 531 // TODO(atwilson): Don't call SignOut() on *any* platform - move this into |
| 532 // the UI layer if needed (sync activity should never result in the user | 532 // the UI layer if needed (sync activity should never result in the user |
| 533 // being logged out of all chrome services). | 533 // being logged out of all chrome services). |
| 534 if (!auto_start_enabled_) | 534 if (!auto_start_enabled_ && !signin_->GetAuthenticatedUsername().empty()) |
| 535 signin_->SignOut(); | 535 signin_->SignOut(); |
| 536 | 536 |
| 537 NotifyObservers(); | 537 NotifyObservers(); |
| 538 } | 538 } |
| 539 | 539 |
| 540 bool ProfileSyncService::HasSyncSetupCompleted() const { | 540 bool ProfileSyncService::HasSyncSetupCompleted() const { |
| 541 return sync_prefs_.HasSyncSetupCompleted(); | 541 return sync_prefs_.HasSyncSetupCompleted(); |
| 542 } | 542 } |
| 543 | 543 |
| 544 void ProfileSyncService::SetSyncSetupCompleted() { | 544 void ProfileSyncService::SetSyncSetupCompleted() { |
| (...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1677 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. | 1677 // See http://stackoverflow.com/questions/6224121/is-new-this-myclass-undefine
d-behaviour-after-directly-calling-the-destru. |
| 1678 ProfileSyncService* old_this = this; | 1678 ProfileSyncService* old_this = this; |
| 1679 this->~ProfileSyncService(); | 1679 this->~ProfileSyncService(); |
| 1680 new(old_this) ProfileSyncService( | 1680 new(old_this) ProfileSyncService( |
| 1681 new ProfileSyncComponentsFactoryImpl(profile, | 1681 new ProfileSyncComponentsFactoryImpl(profile, |
| 1682 CommandLine::ForCurrentProcess()), | 1682 CommandLine::ForCurrentProcess()), |
| 1683 profile, | 1683 profile, |
| 1684 signin, | 1684 signin, |
| 1685 behavior); | 1685 behavior); |
| 1686 } | 1686 } |
| OLD | NEW |