Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "chrome/browser/sync/api/fake_syncable_service.h" | |
| 6 | |
| 7 #include "base/location.h" | |
| 8 | |
| 9 FakeSyncableService::FakeSyncableService() | |
| 10 : syncing_(false), | |
| 11 type_(syncable::UNSPECIFIED) {} | |
| 12 FakeSyncableService::~FakeSyncableService() {} | |
|
akalin
2012/03/06 02:33:47
newline before
Nicolas Zea
2012/03/06 18:27:14
Done.
| |
| 13 | |
| 14 void FakeSyncableService::set_merge_data_and_start_syncing_error( | |
| 15 const SyncError& error) { | |
| 16 merge_data_and_start_syncing_error_ = error; | |
| 17 } | |
| 18 | |
| 19 void FakeSyncableService::set_process_sync_changes_error( | |
| 20 const SyncError& error) { | |
| 21 process_sync_changes_error_ = error; | |
| 22 } | |
| 23 | |
| 24 bool FakeSyncableService::syncing() const { | |
| 25 return syncing_; | |
| 26 } | |
| 27 | |
| 28 // SyncableService implementation. | |
| 29 SyncError FakeSyncableService::MergeDataAndStartSyncing( | |
| 30 syncable::ModelType type, | |
| 31 const SyncDataList& initial_sync_data, | |
| 32 SyncChangeProcessor* sync_processor) { | |
| 33 sync_processor_.reset(sync_processor); | |
| 34 type_ = type; | |
| 35 if (!merge_data_and_start_syncing_error_.IsSet()) { | |
| 36 syncing_ = true; | |
| 37 } | |
| 38 return merge_data_and_start_syncing_error_; | |
| 39 } | |
| 40 | |
| 41 void FakeSyncableService::StopSyncing(syncable::ModelType type) { | |
| 42 syncing_ = false; | |
| 43 } | |
| 44 | |
| 45 SyncDataList FakeSyncableService::GetAllSyncData( | |
| 46 syncable::ModelType type) const { | |
| 47 return SyncDataList(); | |
| 48 } | |
| 49 | |
| 50 SyncError FakeSyncableService::ProcessSyncChanges( | |
| 51 const tracked_objects::Location& from_here, | |
| 52 const SyncChangeList& change_list) { | |
| 53 return process_sync_changes_error_; | |
| 54 } | |
| OLD | NEW |