Index: components/prefs/overlay_user_pref_store.cc |
diff --git a/components/prefs/overlay_user_pref_store.cc b/components/prefs/overlay_user_pref_store.cc |
index 2b2208ed8214408290c312125e5309689dfecaff..c545d0131375a5e9b5df1dd5981d6989b81c6ea3 100644 |
--- a/components/prefs/overlay_user_pref_store.cc |
+++ b/components/prefs/overlay_user_pref_store.cc |
@@ -47,6 +47,24 @@ bool OverlayUserPrefStore::GetValue(const std::string& key, |
return underlay_->GetValue(GetUnderlayKey(key), result); |
} |
+std::unique_ptr<base::DictionaryValue> OverlayUserPrefStore::GetValues() const { |
+ auto values = underlay_->GetValues(); |
+ auto overlay_values = overlay_.AsDictionaryValue(); |
+ for (const auto& overlay_mapping : overlay_to_underlay_names_map_) { |
+ const std::string& overlay_key = overlay_mapping.first; |
+ const std::string& underlay_key = overlay_mapping.first; |
Sam McNally
2017/02/21 01:58:25
second
tibell
2017/02/21 02:11:07
Done.
|
+ std::unique_ptr<base::Value> out_value; |
+ if (overlay_values->Remove(overlay_key, &out_value)) { |
+ values->Set(overlay_key, std::move(out_value)); |
+ } else if (overlay_key != underlay_key) { |
+ if (values->Remove(underlay_key, &out_value)) { |
Sam McNally
2017/02/21 01:58:25
Merge this into the else if?
tibell
2017/02/21 02:11:07
Done.
Reordered things to remove some if-statemen
|
+ values->Set(overlay_key, std::move(out_value)); |
+ } |
+ } |
+ } |
+ return values; |
+} |
+ |
bool OverlayUserPrefStore::GetMutableValue(const std::string& key, |
base::Value** result) { |
if (!ShallBeStoredInOverlay(key)) |