| 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 "components/browser_sync/profile_sync_service.h" | 5 #include "components/browser_sync/profile_sync_service.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <cstddef> | 9 #include <cstddef> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 786 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 797 | 797 |
| 798 NotifyObservers(); | 798 NotifyObservers(); |
| 799 | 799 |
| 800 // Mark this as a clean shutdown(without crash). | 800 // Mark this as a clean shutdown(without crash). |
| 801 sync_prefs_.SetCleanShutdown(true); | 801 sync_prefs_.SetCleanShutdown(true); |
| 802 } | 802 } |
| 803 | 803 |
| 804 void ProfileSyncService::StopImpl(SyncStopDataFate data_fate) { | 804 void ProfileSyncService::StopImpl(SyncStopDataFate data_fate) { |
| 805 switch (data_fate) { | 805 switch (data_fate) { |
| 806 case KEEP_DATA: | 806 case KEEP_DATA: |
| 807 // TODO(maxbogue): Investigate whether this logic can/should be moved | |
| 808 // into ShutdownImpl or the sync engine itself. | |
| 809 if (HasSyncingEngine()) { | |
| 810 engine_->UnregisterInvalidationIds(); | |
| 811 } | |
| 812 ShutdownImpl(syncer::STOP_SYNC); | 807 ShutdownImpl(syncer::STOP_SYNC); |
| 813 break; | 808 break; |
| 814 case CLEAR_DATA: | 809 case CLEAR_DATA: |
| 815 // Clear prefs (including SyncSetupHasCompleted) before shutting down so | 810 // Clear prefs (including SyncSetupHasCompleted) before shutting down so |
| 816 // PSS clients don't think we're set up while we're shutting down. | 811 // PSS clients don't think we're set up while we're shutting down. |
| 817 sync_prefs_.ClearPreferences(); | 812 sync_prefs_.ClearPreferences(); |
| 818 ClearUnrecoverableError(); | 813 ClearUnrecoverableError(); |
| 819 ShutdownImpl(syncer::DISABLE_SYNC); | 814 ShutdownImpl(syncer::DISABLE_SYNC); |
| 820 break; | 815 break; |
| 821 } | 816 } |
| (...skipping 1792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2614 | 2609 |
| 2615 DCHECK(startup_controller_->IsSetupInProgress()); | 2610 DCHECK(startup_controller_->IsSetupInProgress()); |
| 2616 startup_controller_->SetSetupInProgress(false); | 2611 startup_controller_->SetSetupInProgress(false); |
| 2617 | 2612 |
| 2618 if (IsEngineInitialized()) | 2613 if (IsEngineInitialized()) |
| 2619 ReconfigureDatatypeManager(); | 2614 ReconfigureDatatypeManager(); |
| 2620 NotifyObservers(); | 2615 NotifyObservers(); |
| 2621 } | 2616 } |
| 2622 | 2617 |
| 2623 } // namespace browser_sync | 2618 } // namespace browser_sync |
| OLD | NEW |