Chromium Code Reviews| Index: components/user_prefs/tracked/segregated_pref_store.cc |
| diff --git a/components/user_prefs/tracked/segregated_pref_store.cc b/components/user_prefs/tracked/segregated_pref_store.cc |
| index edb1f2059920bb22706c69c36d2aea5f38fbe3e0..374b5c796798369deabc0969cf9f2ca51cdab06c 100644 |
| --- a/components/user_prefs/tracked/segregated_pref_store.cc |
| +++ b/components/user_prefs/tracked/segregated_pref_store.cc |
| @@ -83,6 +83,21 @@ bool SegregatedPrefStore::GetValue(const std::string& key, |
| return StoreForKey(key)->GetValue(key, result); |
| } |
| +std::unique_ptr<base::DictionaryValue> SegregatedPrefStore::GetValues() const { |
| + auto selected_values = selected_pref_store_->GetValues(); |
|
Sam McNally
2017/02/16 02:21:11
These should use the selected store for keys (with
tibell
2017/02/20 00:04:57
Done.
|
| + auto default_values = default_pref_store_->GetValues(); |
| + auto default_iter = base::DictionaryValue::Iterator(*default_values); |
| + while (!default_iter.IsAtEnd()) { |
| + const std::string key = default_iter.key(); |
| + if (!selected_values->HasKey(key)) { |
| + selected_values->SetWithoutPathExpansion( |
| + key, default_iter.value().CreateDeepCopy()); |
| + } |
| + default_iter.Advance(); |
| + } |
| + return selected_values; |
| +} |
| + |
| void SegregatedPrefStore::SetValue(const std::string& key, |
| std::unique_ptr<base::Value> value, |
| uint32_t flags) { |