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/api/fake_syncable_service.h" | 5 #include "chrome/browser/sync/api/fake_syncable_service.h" |
6 | 6 |
7 #include "base/location.h" | 7 #include "base/location.h" |
8 | 8 |
9 FakeSyncableService::FakeSyncableService() | 9 FakeSyncableService::FakeSyncableService() |
10 : syncing_(false), | 10 : syncing_(false), |
(...skipping 12 matching lines...) Expand all Loading... |
23 } | 23 } |
24 | 24 |
25 bool FakeSyncableService::syncing() const { | 25 bool FakeSyncableService::syncing() const { |
26 return syncing_; | 26 return syncing_; |
27 } | 27 } |
28 | 28 |
29 // SyncableService implementation. | 29 // SyncableService implementation. |
30 SyncError FakeSyncableService::MergeDataAndStartSyncing( | 30 SyncError FakeSyncableService::MergeDataAndStartSyncing( |
31 syncable::ModelType type, | 31 syncable::ModelType type, |
32 const SyncDataList& initial_sync_data, | 32 const SyncDataList& initial_sync_data, |
33 SyncChangeProcessor* sync_processor) { | 33 scoped_ptr<SyncChangeProcessor> sync_processor) { |
34 sync_processor_.reset(sync_processor); | 34 sync_processor_ = sync_processor.Pass(); |
35 type_ = type; | 35 type_ = type; |
36 if (!merge_data_and_start_syncing_error_.IsSet()) { | 36 if (!merge_data_and_start_syncing_error_.IsSet()) { |
37 syncing_ = true; | 37 syncing_ = true; |
38 } | 38 } |
39 return merge_data_and_start_syncing_error_; | 39 return merge_data_and_start_syncing_error_; |
40 } | 40 } |
41 | 41 |
42 void FakeSyncableService::StopSyncing(syncable::ModelType type) { | 42 void FakeSyncableService::StopSyncing(syncable::ModelType type) { |
43 syncing_ = false; | 43 syncing_ = false; |
| 44 sync_processor_.reset(); |
44 } | 45 } |
45 | 46 |
46 SyncDataList FakeSyncableService::GetAllSyncData( | 47 SyncDataList FakeSyncableService::GetAllSyncData( |
47 syncable::ModelType type) const { | 48 syncable::ModelType type) const { |
48 return SyncDataList(); | 49 return SyncDataList(); |
49 } | 50 } |
50 | 51 |
51 SyncError FakeSyncableService::ProcessSyncChanges( | 52 SyncError FakeSyncableService::ProcessSyncChanges( |
52 const tracked_objects::Location& from_here, | 53 const tracked_objects::Location& from_here, |
53 const SyncChangeList& change_list) { | 54 const SyncChangeList& change_list) { |
54 return process_sync_changes_error_; | 55 return process_sync_changes_error_; |
55 } | 56 } |
OLD | NEW |