Chromium Code Reviews| Index: chrome/browser/prefs/pref_model_associator_client.h |
| diff --git a/chrome/browser/prefs/pref_model_associator_client.h b/chrome/browser/prefs/pref_model_associator_client.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a5a1cecb42e233f4bd82c8842193f1134ea7d7a3 |
| --- /dev/null |
| +++ b/chrome/browser/prefs/pref_model_associator_client.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_CLIENT_H_ |
| +#define CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_CLIENT_H_ |
| + |
| +#include <map> |
| +#include <string> |
| + |
| +#include "base/macros.h" |
| + |
| +// Type of preference that can have special treatment during synchronisation. |
| +enum PrefModelAssociatorPreferenceType { |
|
gab
2015/09/10 14:15:09
Make this an enum class (or move it inside the Pre
|
| + PREF_MODEL_PREFERENCE_TYPE_LIST, |
| + PREF_MODEL_PREFERENCE_TYPE_DICT, |
| +}; |
| + |
| +// This class stores preferences names that should have local value merged |
| +// with server value during synchronisation instead of being replaced. |
| +class PrefModelAssociatorClient { |
| + public: |
| + PrefModelAssociatorClient(); |
| + virtual ~PrefModelAssociatorClient(); |
| + |
| + // Register a preference that should be merged with server value during |
| + // synchronisation instead of being merged. |
|
gab
2015/09/10 14:15:09
"Should be merged instead of being merged"..? Feel
|
| + void RegisterPreference(const std::string& pref_name, |
|
gab
2015/09/10 14:15:09
Pref registration is already a separate concept in
|
| + PrefModelAssociatorPreferenceType pref_type); |
| + |
| + // Returns whether the preference named |pref_name| should be merged with |
| + // 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/
|
| + // type via |pref_type| (must not be null). |
| + bool IsPreferenceMerged(const std::string& pref_name, |
| + PrefModelAssociatorPreferenceType* pref_type); |
| + |
| + private: |
| + std::map<std::string, PrefModelAssociatorPreferenceType> pref_registry_; |
|
gab
2015/09/10 14:15:09
PrefRegistry is already a separate concept in pref
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(PrefModelAssociatorClient); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_PREFS_PREF_MODEL_ASSOCIATOR_CLIENT_H_ |