| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/prefs/pref_service.h" | 5 #include "chrome/browser/prefs/pref_service.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 244 |
| 245 void PrefService::RegisterFilePathPref(const char* path, | 245 void PrefService::RegisterFilePathPref(const char* path, |
| 246 const FilePath& default_value) { | 246 const FilePath& default_value) { |
| 247 RegisterPreference(path, Value::CreateStringValue(default_value.value())); | 247 RegisterPreference(path, Value::CreateStringValue(default_value.value())); |
| 248 } | 248 } |
| 249 | 249 |
| 250 void PrefService::RegisterListPref(const char* path) { | 250 void PrefService::RegisterListPref(const char* path) { |
| 251 RegisterPreference(path, new ListValue()); | 251 RegisterPreference(path, new ListValue()); |
| 252 } | 252 } |
| 253 | 253 |
| 254 void PrefService::RegisterListPref(const char* path, ListValue* default_value) { |
| 255 RegisterPreference(path, default_value); |
| 256 } |
| 257 |
| 254 void PrefService::RegisterDictionaryPref(const char* path) { | 258 void PrefService::RegisterDictionaryPref(const char* path) { |
| 255 RegisterPreference(path, new DictionaryValue()); | 259 RegisterPreference(path, new DictionaryValue()); |
| 256 } | 260 } |
| 257 | 261 |
| 262 void PrefService::RegisterDictionaryPref(const char* path, |
| 263 DictionaryValue* default_value) { |
| 264 RegisterPreference(path, default_value); |
| 265 } |
| 266 |
| 258 void PrefService::RegisterLocalizedBooleanPref(const char* path, | 267 void PrefService::RegisterLocalizedBooleanPref(const char* path, |
| 259 int locale_default_message_id) { | 268 int locale_default_message_id) { |
| 260 RegisterPreference( | 269 RegisterPreference( |
| 261 path, | 270 path, |
| 262 CreateLocaleDefaultValue(Value::TYPE_BOOLEAN, locale_default_message_id)); | 271 CreateLocaleDefaultValue(Value::TYPE_BOOLEAN, locale_default_message_id)); |
| 263 } | 272 } |
| 264 | 273 |
| 265 void PrefService::RegisterLocalizedIntegerPref(const char* path, | 274 void PrefService::RegisterLocalizedIntegerPref(const char* path, |
| 266 int locale_default_message_id) { | 275 int locale_default_message_id) { |
| 267 RegisterPreference( | 276 RegisterPreference( |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 677 return pref_value_store()->PrefValueFromUserStore(name_.c_str()); | 686 return pref_value_store()->PrefValueFromUserStore(name_.c_str()); |
| 678 } | 687 } |
| 679 | 688 |
| 680 bool PrefService::Preference::IsDefaultValue() const { | 689 bool PrefService::Preference::IsDefaultValue() const { |
| 681 return pref_value_store()->PrefValueFromDefaultStore(name_.c_str()); | 690 return pref_value_store()->PrefValueFromDefaultStore(name_.c_str()); |
| 682 } | 691 } |
| 683 | 692 |
| 684 bool PrefService::Preference::IsUserModifiable() const { | 693 bool PrefService::Preference::IsUserModifiable() const { |
| 685 return pref_value_store()->PrefValueUserModifiable(name_.c_str()); | 694 return pref_value_store()->PrefValueUserModifiable(name_.c_str()); |
| 686 } | 695 } |
| OLD | NEW |