Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(701)

Unified Diff: components/prefs/pref_value_map.cc

Issue 2692203007: Add PrefStore::GetValues (Closed)
Patch Set: Add GetValues to FilesystemJsonPrefStore Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/prefs/pref_value_map.h ('k') | components/prefs/testing_pref_store.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/prefs/pref_value_map.cc
diff --git a/components/prefs/pref_value_map.cc b/components/prefs/pref_value_map.cc
index f0392d25284319b4a7b62340065d14c4d483f56d..ecacf4c73d4b550f61c292d2047646b6776b0493 100644
--- a/components/prefs/pref_value_map.cc
+++ b/components/prefs/pref_value_map.cc
@@ -157,3 +157,11 @@ void PrefValueMap::GetDifferingKeys(
for ( ; other_pref != other_prefs.end(); ++other_pref)
differing_keys->push_back(other_pref->first);
}
+
+std::unique_ptr<base::DictionaryValue> PrefValueMap::AsDictionaryValue() const {
+ auto dictionary = base::MakeUnique<base::DictionaryValue>();
+ for (const auto& value : prefs_) {
+ dictionary->Set(value.first, value.second->CreateDeepCopy());
+ }
+ return dictionary;
+}
« no previous file with comments | « components/prefs/pref_value_map.h ('k') | components/prefs/testing_pref_store.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698