Index: chrome/browser/prefs/pref_model_associator.h |
diff --git a/chrome/browser/prefs/pref_model_associator.h b/chrome/browser/prefs/pref_model_associator.h |
index a05d22c03b15a1fbfdf7d3cac3e77056c60e3959..b969b681b22f88c6d97a5c19837bb0c834b3b5fb 100644 |
--- a/chrome/browser/prefs/pref_model_associator.h |
+++ b/chrome/browser/prefs/pref_model_associator.h |
@@ -18,6 +18,7 @@ |
#include "sync/api/sync_data.h" |
#include "sync/api/syncable_service.h" |
+class PrefModelAssociatorClient; |
class PrefRegistrySyncable; |
class PrefServiceSyncable; |
@@ -32,9 +33,8 @@ class Value; |
// Contains all preference sync related logic. |
// TODO(sync): Merge this into PrefService once we separate the profile |
// PrefService from the local state PrefService. |
-class PrefModelAssociator |
- : public syncer::SyncableService, |
- public base::NonThreadSafe { |
+class PrefModelAssociator : public syncer::SyncableService, |
+ public base::NonThreadSafe { |
public: |
explicit PrefModelAssociator(syncer::ModelType type); |
~PrefModelAssociator() override; |
@@ -58,6 +58,14 @@ class PrefModelAssociator |
// hence should be monitored for changes. |
std::set<std::string> registered_preferences() const; |
+ // Sets the PrefModelAssociatorClient that control special treatment of |
+ // some preferences during synchronisation. Must be called before starting |
+ // the synchronisation. |
+ void set_pref_model_associator_client( |
+ PrefModelAssociatorClient* pref_model_associator_client) { |
+ pref_model_associator_client_ = pref_model_associator_client; |
+ } |
+ |
// Register a preference with the specified name for syncing. We do not care |
// about the type at registration time, but when changes arrive from the |
// syncer, we check if they can be applied and if not drop them. |
@@ -82,7 +90,8 @@ class PrefModelAssociator |
static scoped_ptr<base::Value> MergePreference( |
const std::string& name, |
const base::Value& local_value, |
- const base::Value& server_value); |
+ const base::Value& server_value, |
+ PrefModelAssociatorClient* pref_model_associator_registry); |
// Fills |sync_data| with a sync representation of the preference data |
// provided. |
@@ -123,8 +132,8 @@ class PrefModelAssociator |
const std::string& pref_name, |
syncer::SyncChangeList* sync_changes); |
- static base::Value* MergeListValues( |
- const base::Value& from_value, const base::Value& to_value); |
+ static base::Value* MergeListValues(const base::Value& from_value, |
+ const base::Value& to_value); |
static base::Value* MergeDictionaryValues(const base::Value& from_value, |
const base::Value& to_value); |
@@ -177,6 +186,7 @@ class PrefModelAssociator |
void NotifySyncedPrefObservers(const std::string& path, bool from_sync) const; |
SyncedPrefObserverMap synced_pref_observers_; |
+ PrefModelAssociatorClient* pref_model_associator_client_; |
gab
2015/09/10 14:15:09
Should this be a const*?
|
DISALLOW_COPY_AND_ASSIGN(PrefModelAssociator); |
}; |