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