Let PrefStore::GetValue return a const Value* instead of Value* and add PersistentPrefStore::GetMutableValue
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/6713099
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@79413 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/prefs/pref_service.cc b/chrome/browser/prefs/pref_service.cc
index d9588b56..8e7563f 100644
--- a/chrome/browser/prefs/pref_service.cc
+++ b/chrome/browser/prefs/pref_service.cc
@@ -407,10 +407,6 @@
return user_pref_store_->ReadOnly();
}
-PrefNotifier* PrefService::pref_notifier() const {
- return pref_notifier_.get();
-}
-
bool PrefService::IsManagedPreference(const char* pref_name) const {
const Preference* pref = FindPreference(pref_name);
return pref && pref->IsManaged();
@@ -571,7 +567,7 @@
Value* tmp_value = NULL;
// 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.
- if (user_pref_store_->GetValue(path, &tmp_value)
+ if (user_pref_store_->GetMutableValue(path, &tmp_value)
!= PersistentPrefStore::READ_OK ||
!tmp_value->IsType(Value::TYPE_DICTIONARY)) {
dict = new DictionaryValue;
@@ -601,7 +597,7 @@
Value* tmp_value = NULL;
// 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.
- if (user_pref_store_->GetValue(path, &tmp_value)
+ if (user_pref_store_->GetMutableValue(path, &tmp_value)
!= PersistentPrefStore::READ_OK ||
!tmp_value->IsType(Value::TYPE_LIST)) {
list = new ListValue;
@@ -612,7 +608,7 @@
return list;
}
-void PrefService::ReportValueChanged(const std::string& key) {
+void PrefService::ReportUserPrefChanged(const std::string& key) {
user_pref_store_->ReportValueChanged(key);
}
@@ -657,7 +653,7 @@
DCHECK(pref_service_->FindPreference(name_.c_str())) <<
"Must register pref before getting its value";
- Value* found_value = NULL;
+ const Value* found_value = NULL;
if (pref_value_store()->GetValue(name_, type_, &found_value)) {
DCHECK(found_value->IsType(type_));
return found_value;