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