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

Unified Diff: components/prefs/pref_service.h

Issue 1910323002: Allow whitelisted prefs to be displayed in ChromeOS in chrome://local-state. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
Index: components/prefs/pref_service.h
diff --git a/components/prefs/pref_service.h b/components/prefs/pref_service.h
index 6c95b64f6536eb1e8174bb097bda4b71bfa31099..9fee491a1a556afde5a89faa8a43c0b588c63743 100644
--- a/components/prefs/pref_service.h
+++ b/components/prefs/pref_service.h
@@ -257,6 +257,11 @@ class COMPONENTS_PREFS_EXPORT PrefService : public base::NonThreadSafe {
// are at their default values.
scoped_ptr<base::DictionaryValue> GetPreferenceValuesOmitDefaults() const;
+ // Same as GetPreferenceValuesOmitDefaults, but also filters out preferences
+ // keys that do not match one of the prefixes in |whitelisted_prefixes|.
+ scoped_ptr<base::DictionaryValue> GetWhitelistedPreferenceValuesOmitDefaults(
+ const std::vector<std::string>& whitelisted_prefixes) const;
+
// Returns a dictionary with effective preference values. Contrary to
// GetPreferenceValues(), the paths of registered preferences are not split on
// '.' characters. If a registered preference stores a dictionary, however,
@@ -348,6 +353,11 @@ class COMPONENTS_PREFS_EXPORT PrefService : public base::NonThreadSafe {
virtual void AddPrefObserver(const std::string& path, PrefObserver* obs);
virtual void RemovePrefObserver(const std::string& path, PrefObserver* obs);
+ // Helper function that adds a preference value to a dictionary if it is not
+ // at its default value.
+ void SetPreferenceOmitdefault(const std::string& pref_name,
+ base::DictionaryValue* out) const;
+
// Sends notification of a changed preference. This needs to be called by
// a ScopedUserPrefUpdate if a DictionaryValue or ListValue is changed.
void ReportUserPrefChanged(const std::string& key);

Powered by Google App Engine
This is Rietveld 408576698