diff options
Diffstat (limited to 'chrome/browser/pref_service.cc')
-rw-r--r-- | chrome/browser/pref_service.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/pref_service.cc b/chrome/browser/pref_service.cc index 6abfd0f..d30b544 100644 --- a/chrome/browser/pref_service.cc +++ b/chrome/browser/pref_service.cc @@ -407,6 +407,19 @@ void PrefService::Set(const wchar_t* path, const Value& value) { NOTREACHED() << "Trying to write an unregistered pref: " << path; return; } + + // Allow dictionary and list types to be set to null. + if (value.GetType() == Value::TYPE_NULL && + (pref->type() == Value::TYPE_DICTIONARY || + pref->type() == Value::TYPE_LIST)) { + scoped_ptr<Value> old_value(GetPrefCopy(path)); + if (!old_value->Equals(&value)) { + persistent_->Remove(path, NULL); + FireObservers(path); + } + return; + } + if (pref->type() != value.GetType()) { NOTREACHED() << "Wrong type for Set: " << path; } |