diff options
Diffstat (limited to 'chrome/browser/prefs/pref_service.cc')
-rw-r--r-- | chrome/browser/prefs/pref_service.cc | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/chrome/browser/prefs/pref_service.cc b/chrome/browser/prefs/pref_service.cc index ea1d705..6427c0e 100644 --- a/chrome/browser/prefs/pref_service.cc +++ b/chrome/browser/prefs/pref_service.cc @@ -696,10 +696,8 @@ const base::Value* PrefService::GetUserPrefValue(const char* path) const { // Look for an existing preference in the user store. If it doesn't // exist, return NULL. base::Value* value = NULL; - if (user_pref_store_->GetMutableValue(path, &value) != - PersistentPrefStore::READ_OK) { + if (user_pref_store_->GetMutableValue(path, &value) != PrefStore::READ_OK) return NULL; - } if (!value->IsType(pref->GetType())) { NOTREACHED() << "Pref value type doesn't match registered type."; @@ -709,6 +707,17 @@ const base::Value* PrefService::GetUserPrefValue(const char* path) const { return value; } +const base::Value* PrefService::GetDefaultPrefValue(const char* path) const { + DCHECK(CalledOnValidThread()); + // Lookup the preference in the default store. + const base::Value* value = NULL; + if (default_store_->GetValue(path, &value) != PrefStore::READ_OK) { + NOTREACHED() << "Default value missing for pref: " << path; + return NULL; + } + return value; +} + const ListValue* PrefService::GetList(const char* path) const { DCHECK(CalledOnValidThread()); @@ -870,8 +879,7 @@ Value* PrefService::GetMutableUserPref(const char* path, // Look for an existing preference in the user store. If it doesn't // exist or isn't the correct type, create a new user preference. Value* value = NULL; - if (user_pref_store_->GetMutableValue(path, &value) - != PersistentPrefStore::READ_OK || + if (user_pref_store_->GetMutableValue(path, &value) != PrefStore::READ_OK || !value->IsType(type)) { if (type == Value::TYPE_DICTIONARY) { value = new DictionaryValue; |