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 <map> | |
9 #include <string> | |
10 | |
11 #include "base/macros.h" | |
12 | |
13 // Type of preference that can have special treatment during synchronisation. | |
14 enum PrefModelAssociatorPreferenceType { | |
gab
2015/09/10 14:15:09
Make this an enum class (or move it inside the Pre
| |
15 PREF_MODEL_PREFERENCE_TYPE_LIST, | |
16 PREF_MODEL_PREFERENCE_TYPE_DICT, | |
17 }; | |
18 | |
19 // This class stores preferences names that should have local value merged | |
20 // with server value during synchronisation instead of being replaced. | |
21 class PrefModelAssociatorClient { | |
22 public: | |
23 PrefModelAssociatorClient(); | |
24 virtual ~PrefModelAssociatorClient(); | |
25 | |
26 // Register a preference that should be merged with server value during | |
27 // synchronisation instead of being merged. | |
gab
2015/09/10 14:15:09
"Should be merged instead of being merged"..? Feel
| |
28 void RegisterPreference(const std::string& pref_name, | |
gab
2015/09/10 14:15:09
Pref registration is already a separate concept in
| |
29 PrefModelAssociatorPreferenceType pref_type); | |
30 | |
31 // Returns whether the preference named |pref_name| should be merged with | |
32 // service value during synchronisation instead of being merged, and its | |
gab
2015/09/10 14:15:09
Once again I don't see what you mean by "instead o
gab
2015/09/10 14:15:09
s/, and/as well as/
gab
2015/09/10 14:15:09
s/service/server/
| |
33 // type via |pref_type| (must not be null). | |
34 bool IsPreferenceMerged(const std::string& pref_name, | |
35 PrefModelAssociatorPreferenceType* pref_type); | |
36 | |
37 private: | |
38 std::map<std::string, PrefModelAssociatorPreferenceType> pref_registry_; | |
gab
2015/09/10 14:15:09
PrefRegistry is already a separate concept in pref
| |
39 | |
40 DISALLOW_COPY_AND_ASSIGN(PrefModelAssociatorClient); | |
41 }; | |
42 | |
43 #endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_CLIENT_H_ | |
OLD | NEW |