| 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/sync/engine/fake_sync_manager.h" | 5 #include "components/sync/engine/fake_sync_manager.h" |
| 6 | 6 |
| 7 #include <cstddef> | 7 #include <cstddef> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 119 | 119 |
| 120 void FakeSyncManager::PurgeDisabledTypes(ModelTypeSet to_purge, | 120 void FakeSyncManager::PurgeDisabledTypes(ModelTypeSet to_purge, |
| 121 ModelTypeSet to_journal, | 121 ModelTypeSet to_journal, |
| 122 ModelTypeSet to_unapply) { | 122 ModelTypeSet to_unapply) { |
| 123 // Simulate cleaning up disabled types. | 123 // Simulate cleaning up disabled types. |
| 124 // TODO(sync): consider only cleaning those types that were recently disabled, | 124 // TODO(sync): consider only cleaning those types that were recently disabled, |
| 125 // if this isn't the first cleanup, which more accurately reflects the | 125 // if this isn't the first cleanup, which more accurately reflects the |
| 126 // behavior of the real cleanup logic. | 126 // behavior of the real cleanup logic. |
| 127 GetUserShare()->directory->PurgeEntriesWithTypeIn(to_purge, to_journal, | 127 GetUserShare()->directory->PurgeEntriesWithTypeIn(to_purge, to_journal, |
| 128 to_unapply); | 128 to_unapply); |
| 129 initial_sync_ended_types_.RemoveAll(to_purge); | 129 // Types from |to_unapply| should retain their server data and progress |
| 130 progress_marker_types_.RemoveAll(to_purge); | 130 // markers. |
| 131 ModelTypeSet purged_types = Difference(to_purge, to_unapply); |
| 132 initial_sync_ended_types_.RemoveAll(purged_types); |
| 133 progress_marker_types_.RemoveAll(purged_types); |
| 131 cleaned_types_.PutAll(to_purge); | 134 cleaned_types_.PutAll(to_purge); |
| 132 } | 135 } |
| 133 | 136 |
| 134 void FakeSyncManager::UpdateCredentials(const SyncCredentials& credentials) { | 137 void FakeSyncManager::UpdateCredentials(const SyncCredentials& credentials) { |
| 135 NOTIMPLEMENTED(); | 138 NOTIMPLEMENTED(); |
| 136 } | 139 } |
| 137 | 140 |
| 138 void FakeSyncManager::StartSyncingNormally( | 141 void FakeSyncManager::StartSyncingNormally( |
| 139 const ModelSafeRoutingInfo& routing_info, | 142 const ModelSafeRoutingInfo& routing_info, |
| 140 base::Time last_poll_time) { | 143 base::Time last_poll_time) { |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 262 } | 265 } |
| 263 | 266 |
| 264 void FakeSyncManager::OnCookieJarChanged(bool account_mismatch, | 267 void FakeSyncManager::OnCookieJarChanged(bool account_mismatch, |
| 265 bool empty_jar) {} | 268 bool empty_jar) {} |
| 266 | 269 |
| 267 void FakeSyncManager::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) { | 270 void FakeSyncManager::OnMemoryDump(base::trace_event::ProcessMemoryDump* pmd) { |
| 268 NOTIMPLEMENTED(); | 271 NOTIMPLEMENTED(); |
| 269 } | 272 } |
| 270 | 273 |
| 271 } // namespace syncer | 274 } // namespace syncer |
| OLD | NEW |