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
3 // found in the LICENSE file.
5 #ifndef BASE_PREFS_PREF_REGISTRY_SIMPLE_H_
6 #define BASE_PREFS_PREF_REGISTRY_SIMPLE_H_
10 #include "base/prefs/base_prefs_export.h"
11 #include "base/prefs/pref_registry.h"
14 class DictionaryValue
;
19 // A simple implementation of PrefRegistry.
20 class BASE_PREFS_EXPORT PrefRegistrySimple
: public PrefRegistry
{
24 void RegisterBooleanPref(const std::string
& path
, bool default_value
);
25 void RegisterIntegerPref(const std::string
& path
, int default_value
);
26 void RegisterDoublePref(const std::string
& path
, double default_value
);
27 void RegisterStringPref(const std::string
& path
,
28 const std::string
& default_value
);
29 void RegisterFilePathPref(const std::string
& path
,
30 const base::FilePath
& default_value
);
31 void RegisterListPref(const std::string
& path
);
32 void RegisterDictionaryPref(const std::string
& path
);
33 void RegisterListPref(const std::string
& path
,
34 base::ListValue
* default_value
);
35 void RegisterDictionaryPref(const std::string
& path
,
36 base::DictionaryValue
* default_value
);
37 void RegisterInt64Pref(const std::string
& path
, int64 default_value
);
38 void RegisterUint64Pref(const std::string
&, uint64 default_value
);
40 // Versions of registration functions that accept PrefRegistrationFlags.
41 // |flags| is a bitmask of PrefRegistrationFlags.
42 void RegisterBooleanPref(const std::string
&,
45 void RegisterIntegerPref(const std::string
&, int default_value
, uint32 flags
);
46 void RegisterDoublePref(const std::string
&,
49 void RegisterStringPref(const std::string
&,
50 const std::string
& default_value
,
52 void RegisterFilePathPref(const std::string
&,
53 const base::FilePath
& default_value
,
55 void RegisterListPref(const std::string
&, uint32 flags
);
56 void RegisterDictionaryPref(const std::string
&, uint32 flags
);
57 void RegisterListPref(const std::string
&,
58 base::ListValue
* default_value
,
60 void RegisterDictionaryPref(const std::string
&,
61 base::DictionaryValue
* default_value
,
63 void RegisterInt64Pref(const std::string
&, int64 default_value
, uint32 flags
);
64 void RegisterUint64Pref(const std::string
&,
69 ~PrefRegistrySimple() override
;
71 // Allows subclasses to hook into pref registration.
72 virtual void OnPrefRegistered(const std::string
&,
73 base::Value
* default_value
,
77 void RegisterPrefAndNotify(const std::string
&,
78 base::Value
* default_value
,
81 DISALLOW_COPY_AND_ASSIGN(PrefRegistrySimple
);
84 #endif // BASE_PREFS_PREF_REGISTRY_SIMPLE_H_