1 // Copyright 2012 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_PREFS_PREF_REGISTRY_SIMPLE_H_
6 #define COMPONENTS_PREFS_PREF_REGISTRY_SIMPLE_H_
13 #include "base/time/time.h"
14 #include "base/values.h"
15 #include "components/prefs/pref_registry.h"
16 #include "components/prefs/prefs_export.h"
22 // A simple implementation of PrefRegistry.
23 class COMPONENTS_PREFS_EXPORT PrefRegistrySimple : public PrefRegistry {
27 PrefRegistrySimple(const PrefRegistrySimple&) = delete;
28 PrefRegistrySimple& operator=(const PrefRegistrySimple&) = delete;
30 // For each of these registration methods, |flags| is an optional bitmask of
31 // PrefRegistrationFlags.
32 void RegisterBooleanPref(const std::string& path,
34 uint32_t flags = NO_REGISTRATION_FLAGS);
36 void RegisterIntegerPref(const std::string& path,
38 uint32_t flags = NO_REGISTRATION_FLAGS);
40 void RegisterDoublePref(const std::string& path,
42 uint32_t flags = NO_REGISTRATION_FLAGS);
44 void RegisterStringPref(const std::string& path,
45 const std::string& default_value,
46 uint32_t flags = NO_REGISTRATION_FLAGS);
48 void RegisterFilePathPref(const std::string& path,
49 const base::FilePath& default_value,
50 uint32_t flags = NO_REGISTRATION_FLAGS);
52 void RegisterListPref(const std::string& path,
53 uint32_t flags = NO_REGISTRATION_FLAGS);
55 void RegisterListPref(const std::string& path,
56 base::Value::List default_value,
57 uint32_t flags = NO_REGISTRATION_FLAGS);
59 void RegisterDictionaryPref(const std::string& path,
60 uint32_t flags = NO_REGISTRATION_FLAGS);
62 void RegisterDictionaryPref(const std::string& path,
63 base::Value::Dict default_value,
64 uint32_t flags = NO_REGISTRATION_FLAGS);
66 void RegisterInt64Pref(const std::string& path,
67 int64_t default_value,
68 uint32_t flags = NO_REGISTRATION_FLAGS);
70 void RegisterUint64Pref(const std::string& path,
71 uint64_t default_value,
72 uint32_t flags = NO_REGISTRATION_FLAGS);
74 void RegisterTimePref(const std::string& path,
75 base::Time default_value,
76 uint32_t flags = NO_REGISTRATION_FLAGS);
78 void RegisterTimeDeltaPref(const std::string& path,
79 base::TimeDelta default_value,
80 uint32_t flags = NO_REGISTRATION_FLAGS);
83 ~PrefRegistrySimple() override;
86 #endif // COMPONENTS_PREFS_PREF_REGISTRY_SIMPLE_H_