| 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 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 238 | 238 |
| 239 void PrefService::RegisterFilePathPref(const char* path, | 239 void PrefService::RegisterFilePathPref(const char* path, |
| 240 const FilePath& default_value) { | 240 const FilePath& default_value) { |
| 241 RegisterPreference(path, Value::CreateStringValue(default_value.value())); | 241 RegisterPreference(path, Value::CreateStringValue(default_value.value())); |
| 242 } | 242 } |
| 243 | 243 |
| 244 void PrefService::RegisterListPref(const char* path) { | 244 void PrefService::RegisterListPref(const char* path) { |
| 245 RegisterPreference(path, new ListValue()); | 245 RegisterPreference(path, new ListValue()); |
| 246 } | 246 } |
| 247 | 247 |
| 248 void PrefService::RegisterListPref(const char* path, ListValue* default_value) { |
| 249 RegisterPreference(path, default_value); |
| 250 } |
| 251 |
| 248 void PrefService::RegisterDictionaryPref(const char* path) { | 252 void PrefService::RegisterDictionaryPref(const char* path) { |
| 249 RegisterPreference(path, new DictionaryValue()); | 253 RegisterPreference(path, new DictionaryValue()); |
| 250 } | 254 } |
| 251 | 255 |
| 256 void PrefService::RegisterDictionaryPref(const char* path, |
| 257 DictionaryValue* default_value) { |
| 258 RegisterPreference(path, default_value); |
| 259 } |
| 260 |
| 252 void PrefService::RegisterLocalizedBooleanPref(const char* path, | 261 void PrefService::RegisterLocalizedBooleanPref(const char* path, |
| 253 int locale_default_message_id) { | 262 int locale_default_message_id) { |
| 254 RegisterPreference( | 263 RegisterPreference( |
| 255 path, | 264 path, |
| 256 CreateLocaleDefaultValue(Value::TYPE_BOOLEAN, locale_default_message_id)); | 265 CreateLocaleDefaultValue(Value::TYPE_BOOLEAN, locale_default_message_id)); |
| 257 } | 266 } |
| 258 | 267 |
| 259 void PrefService::RegisterLocalizedIntegerPref(const char* path, | 268 void PrefService::RegisterLocalizedIntegerPref(const char* path, |
| 260 int locale_default_message_id) { | 269 int locale_default_message_id) { |
| 261 RegisterPreference( | 270 RegisterPreference( |
| (...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 675 | 684 |
| 676 bool PrefService::Preference::IsDefaultValue() const { | 685 bool PrefService::Preference::IsDefaultValue() const { |
| 677 return pref_service_->pref_value_store_-> | 686 return pref_service_->pref_value_store_-> |
| 678 PrefValueFromDefaultStore(name_.c_str()); | 687 PrefValueFromDefaultStore(name_.c_str()); |
| 679 } | 688 } |
| 680 | 689 |
| 681 bool PrefService::Preference::IsUserModifiable() const { | 690 bool PrefService::Preference::IsUserModifiable() const { |
| 682 return pref_service_->pref_value_store_-> | 691 return pref_service_->pref_value_store_-> |
| 683 PrefValueUserModifiable(name_.c_str()); | 692 PrefValueUserModifiable(name_.c_str()); |
| 684 } | 693 } |
| OLD | NEW |