Fix emulator build error
[platform/framework/web/chromium-efl.git] / components / prefs / pref_registry_simple.cc
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.
4
5 #include "components/prefs/pref_registry_simple.h"
6
7 #include <utility>
8
9 #include "base/files/file_path.h"
10 #include "base/strings/string_number_conversions.h"
11 #include "base/strings/string_util.h"
12 #include "base/values.h"
13
14 PrefRegistrySimple::PrefRegistrySimple() = default;
15 PrefRegistrySimple::~PrefRegistrySimple() = default;
16
17 void PrefRegistrySimple::RegisterBooleanPref(const std::string& path,
18                                              bool default_value,
19                                              uint32_t flags) {
20   RegisterPreference(path, base::Value(default_value), flags);
21 }
22
23 void PrefRegistrySimple::RegisterIntegerPref(const std::string& path,
24                                              int default_value,
25                                              uint32_t flags) {
26   RegisterPreference(path, base::Value(default_value), flags);
27 }
28
29 void PrefRegistrySimple::RegisterDoublePref(const std::string& path,
30                                             double default_value,
31                                             uint32_t flags) {
32   RegisterPreference(path, base::Value(default_value), flags);
33 }
34
35 void PrefRegistrySimple::RegisterStringPref(const std::string& path,
36                                             const std::string& default_value,
37                                             uint32_t flags) {
38   RegisterPreference(path, base::Value(default_value), flags);
39 }
40
41 void PrefRegistrySimple::RegisterFilePathPref(
42     const std::string& path,
43     const base::FilePath& default_value,
44     uint32_t flags) {
45   RegisterPreference(path, base::Value(default_value.AsUTF8Unsafe()), flags);
46 }
47
48 void PrefRegistrySimple::RegisterListPref(const std::string& path,
49                                           uint32_t flags) {
50   RegisterPreference(path, base::Value(base::Value::Type::LIST), flags);
51 }
52
53 void PrefRegistrySimple::RegisterListPref(const std::string& path,
54                                           base::Value::List default_value,
55                                           uint32_t flags) {
56   RegisterPreference(path, base::Value(std::move(default_value)), flags);
57 }
58
59 void PrefRegistrySimple::RegisterDictionaryPref(const std::string& path,
60                                                 uint32_t flags) {
61   RegisterPreference(path, base::Value(base::Value::Type::DICT), flags);
62 }
63
64 void PrefRegistrySimple::RegisterDictionaryPref(const std::string& path,
65                                                 base::Value::Dict default_value,
66                                                 uint32_t flags) {
67   RegisterPreference(path, base::Value(std::move(default_value)), flags);
68 }
69
70 void PrefRegistrySimple::RegisterInt64Pref(const std::string& path,
71                                            int64_t default_value,
72                                            uint32_t flags) {
73   RegisterPreference(path, base::Value(base::NumberToString(default_value)),
74                      flags);
75 }
76
77 void PrefRegistrySimple::RegisterUint64Pref(const std::string& path,
78                                             uint64_t default_value,
79                                             uint32_t flags) {
80   RegisterPreference(path, base::Value(base::NumberToString(default_value)),
81                      flags);
82 }
83
84 void PrefRegistrySimple::RegisterTimePref(const std::string& path,
85                                           base::Time default_value,
86                                           uint32_t flags) {
87   RegisterInt64Pref(
88       path, default_value.ToDeltaSinceWindowsEpoch().InMicroseconds(), flags);
89 }
90
91 void PrefRegistrySimple::RegisterTimeDeltaPref(const std::string& path,
92                                                base::TimeDelta default_value,
93                                                uint32_t flags) {
94   RegisterInt64Pref(path, default_value.InMicroseconds(), flags);
95 }