Chromium Code Reviews| Index: chrome/browser/prefs/pref_value_store.cc |
| diff --git a/chrome/browser/prefs/pref_value_store.cc b/chrome/browser/prefs/pref_value_store.cc |
| index 8d59f4e52505854dff94849f63a080b5796752f3..0dda7dc045a842021bdc495645559c5b73a745f1 100644 |
| --- a/chrome/browser/prefs/pref_value_store.cc |
| +++ b/chrome/browser/prefs/pref_value_store.cc |
| @@ -118,6 +118,20 @@ bool PrefValueStore::GetValue(const std::string& name, |
| return false; |
| } |
| +bool PrefValueStore::GetRecommendedValue(const std::string& name, |
| + base::Value::Type type, |
| + const Value** out_value) const { |
| + *out_value = NULL; |
| + if (!GetValueFromStore(name.c_str(), RECOMMENDED_STORE, out_value)) |
| + return false; |
| + if (!(*out_value)->IsType(type)) { |
| + LOG(WARNING) << "Expected type for " << name << " is " << type |
| + << " but got " << (*out_value)->GetType(); |
| + return false; |
| + } |
|
Mattias Nissler (ping if slow)
2012/07/27 07:26:11
indentation
bartfab (slow)
2012/07/27 12:14:49
Done.
|
| + return true; |
|
Mattias Nissler (ping if slow)
2012/07/27 07:26:11
seems like the code in this function is essentiall
bartfab (slow)
2012/07/27 12:14:49
Done.
|
| +} |
| + |
| void PrefValueStore::NotifyPrefChanged( |
| const char* path, |
| PrefValueStore::PrefStoreType new_store) { |
| @@ -130,6 +144,10 @@ void PrefValueStore::NotifyPrefChanged( |
| pref_notifier_->OnPreferenceChanged(path); |
| if (pref_sync_associator_) |
| pref_sync_associator_->ProcessPrefChange(path); |
| + // Always fire a notification when the recommended value changes, even if the |
| + // effective value is unchanged. |
|
Mattias Nissler (ping if slow)
2012/07/27 07:26:11
As discussed offline, maybe we want to just drop a
bartfab (slow)
2012/07/27 12:14:49
Fresh profile: Start browser, visit google.com, sh
|
| + } else if (new_store == RECOMMENDED_STORE) { |
| + pref_notifier_->OnPreferenceChanged(path); |
| } |
| } |