| OLD | NEW |
| (Empty) |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_CLIENT_H_ | |
| 6 #define CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_CLIENT_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 | |
| 12 // This class allows the embedder to configure the PrefModelAssociator to | |
| 13 // have a different behaviour when receiving preference synchronisations | |
| 14 // events from the server. | |
| 15 class PrefModelAssociatorClient { | |
| 16 public: | |
| 17 // Returns true if the preference named |pref_name| is a list preference | |
| 18 // whose server value is merged with local value during synchronisation. | |
| 19 virtual bool IsMergeableListPreference( | |
| 20 const std::string& pref_name) const = 0; | |
| 21 | |
| 22 // Returns true if the preference named |pref_name| is a dictionary preference | |
| 23 // whose server value is merged with local value during synchronisation. | |
| 24 virtual bool IsMergeableDictionaryPreference( | |
| 25 const std::string& pref_name) const = 0; | |
| 26 | |
| 27 // Returns true if the preference named |new_pref_name| is the new name for | |
| 28 // an old preference. The old name will be returned via |old_pref_name|. | |
| 29 virtual bool IsMigratedPreference(const std::string& new_pref_name, | |
| 30 std::string* old_pref_name) const = 0; | |
| 31 | |
| 32 // Returns true if the preference named |old_pref_name| is the new name for | |
| 33 // a new preference. The old name will be returned via |new_pref_name|. | |
| 34 virtual bool IsOldMigratedPreference(const std::string& old_pref_name, | |
| 35 std::string* new_pref_name) const = 0; | |
| 36 | |
| 37 protected: | |
| 38 PrefModelAssociatorClient() {} | |
| 39 virtual ~PrefModelAssociatorClient() {} | |
| 40 | |
| 41 private: | |
| 42 DISALLOW_COPY_AND_ASSIGN(PrefModelAssociatorClient); | |
| 43 }; | |
| 44 | |
| 45 #endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_CLIENT_H_ | |
| OLD | NEW |