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 void ProcessSyncChanges(const tracked_objects::Location& from_here, | 40 virtual bool ProcessSyncChanges(const tracked_objects::Location& from_here, |
41 const SyncChangeList& change_list) OVERRIDE; | 41 const SyncChangeList& change_list, |
| 42 SyncError* error) OVERRIDE; |
42 virtual bool MergeDataAndStartSyncing( | 43 virtual bool MergeDataAndStartSyncing( |
43 syncable::ModelType type, | 44 syncable::ModelType type, |
44 const SyncDataList& initial_sync_data, | 45 const SyncDataList& initial_sync_data, |
45 SyncChangeProcessor* sync_processor) OVERRIDE; | 46 SyncChangeProcessor* sync_processor, |
| 47 SyncError* error) OVERRIDE; |
46 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; | 48 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; |
47 | 49 |
48 // Returns the list of preference names that are registered as syncable, and | 50 // Returns the list of preference names that are registered as syncable, and |
49 // hence should be monitored for changes. | 51 // hence should be monitored for changes. |
50 std::set<std::string> registered_preferences() const; | 52 std::set<std::string> registered_preferences() const; |
51 | 53 |
52 // Register a preference with the specified name for syncing. We do not care | 54 // Register a preference with the specified name for syncing. We do not care |
53 // about the type at registration time, but when changes arrive from the | 55 // about the type at registration time, but when changes arrive from the |
54 // syncer, we check if they can be applied and if not drop them. | 56 // syncer, we check if they can be applied and if not drop them. |
55 // Note: This should only be called at profile startup time (before sync | 57 // Note: This should only be called at profile startup time (before sync |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
140 // The PrefService we are syncing to. | 142 // The PrefService we are syncing to. |
141 PrefService* pref_service_; | 143 PrefService* pref_service_; |
142 | 144 |
143 // Sync's SyncChange handler. We push all our changes through this. | 145 // Sync's SyncChange handler. We push all our changes through this. |
144 SyncChangeProcessor* sync_processor_; | 146 SyncChangeProcessor* sync_processor_; |
145 | 147 |
146 DISALLOW_COPY_AND_ASSIGN(PrefModelAssociator); | 148 DISALLOW_COPY_AND_ASSIGN(PrefModelAssociator); |
147 }; | 149 }; |
148 | 150 |
149 #endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ | 151 #endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ |
OLD | NEW |