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..7add270311eb10a19de2467755dcf63640074435 100644 |
--- a/components/prefs/overlay_user_pref_store.cc |
+++ b/components/prefs/overlay_user_pref_store.cc |
@@ -47,6 +47,21 @@ bool OverlayUserPrefStore::GetValue(const std::string& key, |
return underlay_->GetValue(GetUnderlayKey(key), result); |
} |
+std::unique_ptr<base::DictionaryValue> OverlayUserPrefStore::GetValues() const { |
+ auto overlay_values = overlay_.AsDictionaryValue(); |
+ auto underlay_values = underlay_->GetValues(); |
+ auto underlay_iter = base::DictionaryValue::Iterator(*underlay_values); |
+ while (!underlay_iter.IsAtEnd()) { |
+ const std::string overlay_key = GetOverlayKey(underlay_iter.key()); |
Sam McNally
2017/02/16 02:21:11
const std::string&
tibell
2017/02/20 00:04:57
Done.
|
+ if (!overlay_values->HasKey(overlay_key)) { |
+ overlay_values->SetWithoutPathExpansion( |
+ overlay_key, underlay_iter.value().CreateDeepCopy()); |
+ } |
+ underlay_iter.Advance(); |
+ } |
+ return overlay_values; |
+} |
+ |
bool OverlayUserPrefStore::GetMutableValue(const std::string& key, |
base::Value** result) { |
if (!ShallBeStoredInOverlay(key)) |