| 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 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 | 233 |
| 234 void PrefService::RegisterFilePathPref(const char* path, | 234 void PrefService::RegisterFilePathPref(const char* path, |
| 235 const FilePath& default_value) { | 235 const FilePath& default_value) { |
| 236 RegisterPreference(path, Value::CreateStringValue(default_value.value())); | 236 RegisterPreference(path, Value::CreateStringValue(default_value.value())); |
| 237 } | 237 } |
| 238 | 238 |
| 239 void PrefService::RegisterListPref(const char* path) { | 239 void PrefService::RegisterListPref(const char* path) { |
| 240 RegisterPreference(path, new ListValue()); | 240 RegisterPreference(path, new ListValue()); |
| 241 } | 241 } |
| 242 | 242 |
| 243 void PrefService::RegisterListPref(const char* path, ListValue* default_value) { |
| 244 RegisterPreference(path, default_value); |
| 245 } |
| 246 |
| 243 void PrefService::RegisterDictionaryPref(const char* path) { | 247 void PrefService::RegisterDictionaryPref(const char* path) { |
| 244 RegisterPreference(path, new DictionaryValue()); | 248 RegisterPreference(path, new DictionaryValue()); |
| 245 } | 249 } |
| 246 | 250 |
| 251 void PrefService::RegisterDictionaryPref(const char* path, |
| 252 DictionaryValue* default_value) { |
| 253 RegisterPreference(path, default_value); |
| 254 } |
| 255 |
| 247 void PrefService::RegisterLocalizedBooleanPref(const char* path, | 256 void PrefService::RegisterLocalizedBooleanPref(const char* path, |
| 248 int locale_default_message_id) { | 257 int locale_default_message_id) { |
| 249 RegisterPreference( | 258 RegisterPreference( |
| 250 path, | 259 path, |
| 251 CreateLocaleDefaultValue(Value::TYPE_BOOLEAN, locale_default_message_id)); | 260 CreateLocaleDefaultValue(Value::TYPE_BOOLEAN, locale_default_message_id)); |
| 252 } | 261 } |
| 253 | 262 |
| 254 void PrefService::RegisterLocalizedIntegerPref(const char* path, | 263 void PrefService::RegisterLocalizedIntegerPref(const char* path, |
| 255 int locale_default_message_id) { | 264 int locale_default_message_id) { |
| 256 RegisterPreference( | 265 RegisterPreference( |
| (...skipping 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 659 | 668 |
| 660 bool PrefService::Preference::IsDefaultValue() const { | 669 bool PrefService::Preference::IsDefaultValue() const { |
| 661 return pref_service_->pref_value_store_-> | 670 return pref_service_->pref_value_store_-> |
| 662 PrefValueFromDefaultStore(name_.c_str()); | 671 PrefValueFromDefaultStore(name_.c_str()); |
| 663 } | 672 } |
| 664 | 673 |
| 665 bool PrefService::Preference::IsUserModifiable() const { | 674 bool PrefService::Preference::IsUserModifiable() const { |
| 666 return pref_service_->pref_value_store_-> | 675 return pref_service_->pref_value_store_-> |
| 667 PrefValueUserModifiable(name_.c_str()); | 676 PrefValueUserModifiable(name_.c_str()); |
| 668 } | 677 } |
| OLD | NEW |