| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "components/prefs/pref_registry_simple.h" | 5 #include "components/prefs/pref_registry_simple.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 | 10 |
| 11 PrefRegistrySimple::PrefRegistrySimple() { | 11 PrefRegistrySimple::PrefRegistrySimple() { |
| 12 } | 12 } |
| 13 | 13 |
| 14 PrefRegistrySimple::~PrefRegistrySimple() { | 14 PrefRegistrySimple::~PrefRegistrySimple() { |
| 15 } | 15 } |
| 16 | 16 |
| 17 void PrefRegistrySimple::RegisterBooleanPref(const std::string& path, | 17 void PrefRegistrySimple::RegisterBooleanPref(const std::string& path, |
| 18 bool default_value) { | 18 bool default_value) { |
| 19 RegisterPrefAndNotify(path, new base::FundamentalValue(default_value), | 19 RegisterPrefAndNotify(path, new base::Value(default_value), |
| 20 NO_REGISTRATION_FLAGS); | 20 NO_REGISTRATION_FLAGS); |
| 21 } | 21 } |
| 22 | 22 |
| 23 void PrefRegistrySimple::RegisterIntegerPref(const std::string& path, | 23 void PrefRegistrySimple::RegisterIntegerPref(const std::string& path, |
| 24 int default_value) { | 24 int default_value) { |
| 25 RegisterPrefAndNotify(path, new base::FundamentalValue(default_value), | 25 RegisterPrefAndNotify(path, new base::Value(default_value), |
| 26 NO_REGISTRATION_FLAGS); | 26 NO_REGISTRATION_FLAGS); |
| 27 } | 27 } |
| 28 | 28 |
| 29 void PrefRegistrySimple::RegisterDoublePref(const std::string& path, | 29 void PrefRegistrySimple::RegisterDoublePref(const std::string& path, |
| 30 double default_value) { | 30 double default_value) { |
| 31 RegisterPrefAndNotify(path, new base::FundamentalValue(default_value), | 31 RegisterPrefAndNotify(path, new base::Value(default_value), |
| 32 NO_REGISTRATION_FLAGS); | 32 NO_REGISTRATION_FLAGS); |
| 33 } | 33 } |
| 34 | 34 |
| 35 void PrefRegistrySimple::RegisterStringPref(const std::string& path, | 35 void PrefRegistrySimple::RegisterStringPref(const std::string& path, |
| 36 const std::string& default_value) { | 36 const std::string& default_value) { |
| 37 RegisterPrefAndNotify(path, new base::StringValue(default_value), | 37 RegisterPrefAndNotify(path, new base::StringValue(default_value), |
| 38 NO_REGISTRATION_FLAGS); | 38 NO_REGISTRATION_FLAGS); |
| 39 } | 39 } |
| 40 | 40 |
| 41 void PrefRegistrySimple::RegisterFilePathPref( | 41 void PrefRegistrySimple::RegisterFilePathPref( |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 void PrefRegistrySimple::RegisterUint64Pref(const std::string& path, | 75 void PrefRegistrySimple::RegisterUint64Pref(const std::string& path, |
| 76 uint64_t default_value) { | 76 uint64_t default_value) { |
| 77 RegisterPrefAndNotify( | 77 RegisterPrefAndNotify( |
| 78 path, new base::StringValue(base::Uint64ToString(default_value)), | 78 path, new base::StringValue(base::Uint64ToString(default_value)), |
| 79 NO_REGISTRATION_FLAGS); | 79 NO_REGISTRATION_FLAGS); |
| 80 } | 80 } |
| 81 | 81 |
| 82 void PrefRegistrySimple::RegisterBooleanPref(const std::string& path, | 82 void PrefRegistrySimple::RegisterBooleanPref(const std::string& path, |
| 83 bool default_value, | 83 bool default_value, |
| 84 uint32_t flags) { | 84 uint32_t flags) { |
| 85 RegisterPrefAndNotify(path, new base::FundamentalValue(default_value), flags); | 85 RegisterPrefAndNotify(path, new base::Value(default_value), flags); |
| 86 } | 86 } |
| 87 | 87 |
| 88 void PrefRegistrySimple::RegisterIntegerPref(const std::string& path, | 88 void PrefRegistrySimple::RegisterIntegerPref(const std::string& path, |
| 89 int default_value, | 89 int default_value, |
| 90 uint32_t flags) { | 90 uint32_t flags) { |
| 91 RegisterPrefAndNotify(path, new base::FundamentalValue(default_value), flags); | 91 RegisterPrefAndNotify(path, new base::Value(default_value), flags); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void PrefRegistrySimple::RegisterDoublePref(const std::string& path, | 94 void PrefRegistrySimple::RegisterDoublePref(const std::string& path, |
| 95 double default_value, | 95 double default_value, |
| 96 uint32_t flags) { | 96 uint32_t flags) { |
| 97 RegisterPrefAndNotify(path, new base::FundamentalValue(default_value), flags); | 97 RegisterPrefAndNotify(path, new base::Value(default_value), flags); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void PrefRegistrySimple::RegisterStringPref(const std::string& path, | 100 void PrefRegistrySimple::RegisterStringPref(const std::string& path, |
| 101 const std::string& default_value, | 101 const std::string& default_value, |
| 102 uint32_t flags) { | 102 uint32_t flags) { |
| 103 RegisterPrefAndNotify(path, new base::StringValue(default_value), flags); | 103 RegisterPrefAndNotify(path, new base::StringValue(default_value), flags); |
| 104 } | 104 } |
| 105 | 105 |
| 106 void PrefRegistrySimple::RegisterFilePathPref( | 106 void PrefRegistrySimple::RegisterFilePathPref( |
| 107 const std::string& path, | 107 const std::string& path, |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 void PrefRegistrySimple::OnPrefRegistered(const std::string& path, | 151 void PrefRegistrySimple::OnPrefRegistered(const std::string& path, |
| 152 base::Value* default_value, | 152 base::Value* default_value, |
| 153 uint32_t flags) {} | 153 uint32_t flags) {} |
| 154 | 154 |
| 155 void PrefRegistrySimple::RegisterPrefAndNotify(const std::string& path, | 155 void PrefRegistrySimple::RegisterPrefAndNotify(const std::string& path, |
| 156 base::Value* default_value, | 156 base::Value* default_value, |
| 157 uint32_t flags) { | 157 uint32_t flags) { |
| 158 RegisterPreference(path, default_value, flags); | 158 RegisterPreference(path, default_value, flags); |
| 159 OnPrefRegistered(path, default_value, flags); | 159 OnPrefRegistered(path, default_value, flags); |
| 160 } | 160 } |
| OLD | NEW |