| 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 25 matching lines...) Expand all Loading... |
| 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 SyncError ProcessSyncChanges( |
| 41 const tracked_objects::Location& from_here, | 41 const tracked_objects::Location& from_here, |
| 42 const SyncChangeList& change_list) OVERRIDE; | 42 const SyncChangeList& change_list) OVERRIDE; |
| 43 virtual SyncError MergeDataAndStartSyncing( | 43 virtual SyncError MergeDataAndStartSyncing( |
| 44 syncable::ModelType type, | 44 syncable::ModelType type, |
| 45 const SyncDataList& initial_sync_data, | 45 const SyncDataList& initial_sync_data, |
| 46 SyncChangeProcessor* sync_processor) OVERRIDE; | 46 scoped_ptr<SyncChangeProcessor> sync_processor) OVERRIDE; |
| 47 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; | 47 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; |
| 48 | 48 |
| 49 // Returns the list of preference names that are registered as syncable, and | 49 // Returns the list of preference names that are registered as syncable, and |
| 50 // hence should be monitored for changes. | 50 // hence should be monitored for changes. |
| 51 std::set<std::string> registered_preferences() const; | 51 std::set<std::string> registered_preferences() const; |
| 52 | 52 |
| 53 // Register a preference with the specified name for syncing. We do not care | 53 // Register a preference with the specified name for syncing. We do not care |
| 54 // about the type at registration time, but when changes arrive from the | 54 // about the type at registration time, but when changes arrive from the |
| 55 // syncer, we check if they can be applied and if not drop them. | 55 // syncer, we check if they can be applied and if not drop them. |
| 56 // Note: This should only be called at profile startup time (before sync | 56 // Note: This should only be called at profile startup time (before sync |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 // Note: this set never decreases, only grows to eventually match | 134 // Note: this set never decreases, only grows to eventually match |
| 135 // registered_preferences_ as more preferences are synced. It determines | 135 // registered_preferences_ as more preferences are synced. It determines |
| 136 // whether a preference change should update an existing sync node or create | 136 // whether a preference change should update an existing sync node or create |
| 137 // a new sync node. | 137 // a new sync node. |
| 138 PreferenceSet synced_preferences_; | 138 PreferenceSet synced_preferences_; |
| 139 | 139 |
| 140 // The PrefService we are syncing to. | 140 // The PrefService we are syncing to. |
| 141 PrefService* pref_service_; | 141 PrefService* pref_service_; |
| 142 | 142 |
| 143 // Sync's SyncChange handler. We push all our changes through this. | 143 // Sync's SyncChange handler. We push all our changes through this. |
| 144 SyncChangeProcessor* sync_processor_; | 144 scoped_ptr<SyncChangeProcessor> sync_processor_; |
| 145 | 145 |
| 146 DISALLOW_COPY_AND_ASSIGN(PrefModelAssociator); | 146 DISALLOW_COPY_AND_ASSIGN(PrefModelAssociator); |
| 147 }; | 147 }; |
| 148 | 148 |
| 149 #endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ | 149 #endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ |
| OLD | NEW |