| 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 SyncError ProcessSyncChanges( |
| 41 const SyncChangeList& change_list) OVERRIDE; | 41 const tracked_objects::Location& from_here, |
| 42 virtual bool MergeDataAndStartSyncing( | 42 const SyncChangeList& change_list) OVERRIDE; |
| 43 virtual SyncError 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) OVERRIDE; |
| 46 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; | 47 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; |
| 47 | 48 |
| 48 // 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 |
| 49 // hence should be monitored for changes. | 50 // hence should be monitored for changes. |
| 50 std::set<std::string> registered_preferences() const; | 51 std::set<std::string> registered_preferences() const; |
| 51 | 52 |
| 52 // 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 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 // The PrefService we are syncing to. | 141 // The PrefService we are syncing to. |
| 141 PrefService* pref_service_; | 142 PrefService* pref_service_; |
| 142 | 143 |
| 143 // Sync's SyncChange handler. We push all our changes through this. | 144 // Sync's SyncChange handler. We push all our changes through this. |
| 144 SyncChangeProcessor* sync_processor_; | 145 SyncChangeProcessor* sync_processor_; |
| 145 | 146 |
| 146 DISALLOW_COPY_AND_ASSIGN(PrefModelAssociator); | 147 DISALLOW_COPY_AND_ASSIGN(PrefModelAssociator); |
| 147 }; | 148 }; |
| 148 | 149 |
| 149 #endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ | 150 #endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ |
| OLD | NEW |