OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #ifndef CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ | 5 #ifndef CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ |
6 #define CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ | 6 #define CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 19 matching lines...) Expand all Loading... |
30 // PrefService from the local state PrefService. | 30 // PrefService from the local state PrefService. |
31 class PrefModelAssociator | 31 class PrefModelAssociator |
32 : public SyncableService, | 32 : public SyncableService, |
33 public base::NonThreadSafe { | 33 public base::NonThreadSafe { |
34 public: | 34 public: |
35 explicit PrefModelAssociator(PrefService* pref_service); | 35 explicit PrefModelAssociator(PrefService* pref_service); |
36 virtual ~PrefModelAssociator(); | 36 virtual ~PrefModelAssociator(); |
37 | 37 |
38 // SyncableService implementation. | 38 // SyncableService implementation. |
39 virtual SyncDataList GetAllSyncData(syncable::ModelType type) const OVERRIDE; | 39 virtual SyncDataList GetAllSyncData(syncable::ModelType type) const OVERRIDE; |
40 virtual SyncError ProcessSyncChanges( | 40 virtual void ProcessSyncChanges(const tracked_objects::Location& from_here, |
41 const tracked_objects::Location& from_here, | 41 const SyncChangeList& change_list) OVERRIDE; |
42 const SyncChangeList& change_list) OVERRIDE; | 42 virtual bool MergeDataAndStartSyncing( |
43 virtual SyncError MergeDataAndStartSyncing( | |
44 syncable::ModelType type, | 43 syncable::ModelType type, |
45 const SyncDataList& initial_sync_data, | 44 const SyncDataList& initial_sync_data, |
46 SyncChangeProcessor* sync_processor) OVERRIDE; | 45 SyncChangeProcessor* sync_processor) OVERRIDE; |
47 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; | 46 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; |
48 | 47 |
49 // Returns the list of preference names that are registered as syncable, and | 48 // Returns the list of preference names that are registered as syncable, and |
50 // hence should be monitored for changes. | 49 // hence should be monitored for changes. |
51 std::set<std::string> registered_preferences() const; | 50 std::set<std::string> registered_preferences() const; |
52 | 51 |
53 // Register a preference with the specified name for syncing. We do not care | 52 // Register a preference with the specified name for syncing. We do not care |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // The PrefService we are syncing to. | 140 // The PrefService we are syncing to. |
142 PrefService* pref_service_; | 141 PrefService* pref_service_; |
143 | 142 |
144 // Sync's SyncChange handler. We push all our changes through this. | 143 // Sync's SyncChange handler. We push all our changes through this. |
145 SyncChangeProcessor* sync_processor_; | 144 SyncChangeProcessor* sync_processor_; |
146 | 145 |
147 DISALLOW_COPY_AND_ASSIGN(PrefModelAssociator); | 146 DISALLOW_COPY_AND_ASSIGN(PrefModelAssociator); |
148 }; | 147 }; |
149 | 148 |
150 #endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ | 149 #endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ |
OLD | NEW |