| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 syncer::SyncableService, | 32 : public syncer::SyncableService, |
| 33 public base::NonThreadSafe { | 33 public base::NonThreadSafe { |
| 34 public: | 34 public: |
| 35 PrefModelAssociator(); | 35 PrefModelAssociator(); |
| 36 virtual ~PrefModelAssociator(); | 36 virtual ~PrefModelAssociator(); |
| 37 | 37 |
| 38 // syncer::SyncableService implementation. | 38 // syncer::SyncableService implementation. |
| 39 virtual syncer::SyncDataList GetAllSyncData( | 39 virtual syncer::SyncDataList GetAllSyncData( |
| 40 syncable::ModelType type) const OVERRIDE; | 40 syncer::ModelType type) const OVERRIDE; |
| 41 virtual syncer::SyncError ProcessSyncChanges( | 41 virtual syncer::SyncError ProcessSyncChanges( |
| 42 const tracked_objects::Location& from_here, | 42 const tracked_objects::Location& from_here, |
| 43 const syncer::SyncChangeList& change_list) OVERRIDE; | 43 const syncer::SyncChangeList& change_list) OVERRIDE; |
| 44 virtual syncer::SyncError MergeDataAndStartSyncing( | 44 virtual syncer::SyncError MergeDataAndStartSyncing( |
| 45 syncable::ModelType type, | 45 syncer::ModelType type, |
| 46 const syncer::SyncDataList& initial_sync_data, | 46 const syncer::SyncDataList& initial_sync_data, |
| 47 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, | 47 scoped_ptr<syncer::SyncChangeProcessor> sync_processor, |
| 48 scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) OVERRIDE; | 48 scoped_ptr<syncer::SyncErrorFactory> sync_error_factory) OVERRIDE; |
| 49 virtual void StopSyncing(syncable::ModelType type) OVERRIDE; | 49 virtual void StopSyncing(syncer::ModelType type) OVERRIDE; |
| 50 | 50 |
| 51 // Returns the list of preference names that are registered as syncable, and | 51 // Returns the list of preference names that are registered as syncable, and |
| 52 // hence should be monitored for changes. | 52 // hence should be monitored for changes. |
| 53 std::set<std::string> registered_preferences() const; | 53 std::set<std::string> registered_preferences() const; |
| 54 | 54 |
| 55 // Register a preference with the specified name for syncing. We do not care | 55 // Register a preference with the specified name for syncing. We do not care |
| 56 // about the type at registration time, but when changes arrive from the | 56 // about the type at registration time, but when changes arrive from the |
| 57 // syncer, we check if they can be applied and if not drop them. | 57 // syncer, we check if they can be applied and if not drop them. |
| 58 // Note: This should only be called at profile startup time (before sync | 58 // Note: This should only be called at profile startup time (before sync |
| 59 // begins). | 59 // begins). |
| (...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 // Sync's syncer::SyncChange handler. We push all our changes through this. | 145 // Sync's syncer::SyncChange handler. We push all our changes through this. |
| 146 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; | 146 scoped_ptr<syncer::SyncChangeProcessor> sync_processor_; |
| 147 | 147 |
| 148 // Sync's error handler. We use this to create sync errors. | 148 // Sync's error handler. We use this to create sync errors. |
| 149 scoped_ptr<syncer::SyncErrorFactory> sync_error_factory_; | 149 scoped_ptr<syncer::SyncErrorFactory> sync_error_factory_; |
| 150 | 150 |
| 151 DISALLOW_COPY_AND_ASSIGN(PrefModelAssociator); | 151 DISALLOW_COPY_AND_ASSIGN(PrefModelAssociator); |
| 152 }; | 152 }; |
| 153 | 153 |
| 154 #endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ | 154 #endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ |
| OLD | NEW |