OLD | NEW |
| (Empty) |
1 // Copyright 2013 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 #ifndef COMPONENTS_SYNC_API_FAKE_SYNC_CHANGE_PROCESSOR_H_ | |
6 #define COMPONENTS_SYNC_API_FAKE_SYNC_CHANGE_PROCESSOR_H_ | |
7 | |
8 #include <string> | |
9 | |
10 #include "base/macros.h" | |
11 #include "components/sync/api/sync_change_processor.h" | |
12 | |
13 namespace syncer { | |
14 | |
15 class FakeSyncChangeProcessor : public SyncChangeProcessor { | |
16 public: | |
17 FakeSyncChangeProcessor(); | |
18 ~FakeSyncChangeProcessor() override; | |
19 | |
20 // SyncChangeProcessor implementation. | |
21 // | |
22 // ProcessSyncChanges will accumulate changes in changes() until they are | |
23 // cleared. | |
24 SyncError ProcessSyncChanges(const tracked_objects::Location& from_here, | |
25 const SyncChangeList& change_list) override; | |
26 | |
27 // SyncChangeProcessor implementation. | |
28 // | |
29 // Returns data(). | |
30 SyncDataList GetAllSyncData(ModelType type) const override; | |
31 | |
32 // SyncChangeProcessor implementation. | |
33 // | |
34 // Updates context(). | |
35 SyncError UpdateDataTypeContext(ModelType type, | |
36 ContextRefreshStatus refresh_status, | |
37 const std::string& context) override; | |
38 void AddLocalChangeObserver(LocalChangeObserver* observer) override; | |
39 void RemoveLocalChangeObserver(LocalChangeObserver* observer) override; | |
40 | |
41 virtual const SyncChangeList& changes() const; | |
42 virtual SyncChangeList& changes(); | |
43 | |
44 virtual const SyncDataList& data() const; | |
45 virtual SyncDataList& data(); | |
46 | |
47 virtual const std::string& context() const; | |
48 virtual std::string& context(); | |
49 | |
50 private: | |
51 SyncChangeList changes_; | |
52 SyncDataList data_; | |
53 std::string context_; | |
54 | |
55 DISALLOW_COPY_AND_ASSIGN(FakeSyncChangeProcessor); | |
56 }; | |
57 | |
58 } // namespace syncer | |
59 | |
60 #endif // COMPONENTS_SYNC_API_FAKE_SYNC_CHANGE_PROCESSOR_H_ | |
OLD | NEW |