| 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 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 85 const std::string& name, | 85 const std::string& name, |
| 86 const base::Value& local_value, | 86 const base::Value& local_value, |
| 87 const base::Value& server_value); | 87 const base::Value& server_value); |
| 88 | 88 |
| 89 // Fills |sync_data| with a sync representation of the preference data | 89 // Fills |sync_data| with a sync representation of the preference data |
| 90 // provided. | 90 // provided. |
| 91 bool CreatePrefSyncData(const std::string& name, | 91 bool CreatePrefSyncData(const std::string& name, |
| 92 const base::Value& value, | 92 const base::Value& value, |
| 93 syncer::SyncData* sync_data) const; | 93 syncer::SyncData* sync_data) const; |
| 94 | 94 |
| 95 // Extract preference value and name from sync specifics. | 95 // Extract preference value from sync specifics. |
| 96 base::Value* ReadPreferenceSpecifics( | 96 base::Value* ReadPreferenceSpecifics( |
| 97 const sync_pb::PreferenceSpecifics& specifics, | 97 const sync_pb::PreferenceSpecifics& specifics); |
| 98 std::string* name); | |
| 99 | 98 |
| 100 // Returns true if the pref under the given name is pulled down from sync. | 99 // Returns true if the pref under the given name is pulled down from sync. |
| 101 // Note this does not refer to SYNCABLE_PREF. | 100 // Note this does not refer to SYNCABLE_PREF. |
| 102 bool IsPrefSynced(const std::string& name) const; | 101 bool IsPrefSynced(const std::string& name) const; |
| 103 | 102 |
| 104 // Adds a SyncedPrefObserver to watch for changes to a specific pref. | 103 // Adds a SyncedPrefObserver to watch for changes to a specific pref. |
| 105 void AddSyncedPrefObserver(const std::string& name, | 104 void AddSyncedPrefObserver(const std::string& name, |
| 106 SyncedPrefObserver* observer); | 105 SyncedPrefObserver* observer); |
| 107 | 106 |
| 108 // Removes a SyncedPrefObserver from a pref's list of observers. | 107 // Removes a SyncedPrefObserver from a pref's list of observers. |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 SyncedPrefObserverMap; | 185 SyncedPrefObserverMap; |
| 187 | 186 |
| 188 void NotifySyncedPrefObservers(const std::string& path, bool from_sync) const; | 187 void NotifySyncedPrefObservers(const std::string& path, bool from_sync) const; |
| 189 | 188 |
| 190 SyncedPrefObserverMap synced_pref_observers_; | 189 SyncedPrefObserverMap synced_pref_observers_; |
| 191 | 190 |
| 192 DISALLOW_COPY_AND_ASSIGN(PrefModelAssociator); | 191 DISALLOW_COPY_AND_ASSIGN(PrefModelAssociator); |
| 193 }; | 192 }; |
| 194 | 193 |
| 195 #endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ | 194 #endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_H_ |
| OLD | NEW |