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

Unified Diff: chrome/browser/prefs/pref_value_store.h

Issue 10821047: Provide access to recommended pref values (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Nits addressed. Created 8 years, 5 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 | « chrome/browser/prefs/pref_service_unittest.cc ('k') | chrome/browser/prefs/pref_value_store.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/prefs/pref_value_store.h
diff --git a/chrome/browser/prefs/pref_value_store.h b/chrome/browser/prefs/pref_value_store.h
index 30c2017dfe05477ecc7ca43d80ebcfb9d543132b..08ff23f020592998f5914fc4967878465912d3d2 100644
--- a/chrome/browser/prefs/pref_value_store.h
+++ b/chrome/browser/prefs/pref_value_store.h
@@ -71,6 +71,15 @@ class PrefValueStore {
base::Value::Type type,
const Value** out_value) const;
+ // Gets the recommended value for the given preference name that has the
+ // specified value type. A value stored in the recommended PrefStore that has
+ // the matching |name| but a non-matching |type| is silently ignored. Returns
+ // true if a valid value was found. Most callers should use
+ // Preference::GetRecommendedValue() instead of calling this method directly.
+ bool GetRecommendedValue(const std::string& name,
+ base::Value::Type type,
+ const Value** out_value) const;
+
// These methods return true if a preference with the given name is in the
// indicated pref store, even if that value is currently being overridden by
// a higher-priority source.
@@ -183,11 +192,17 @@ class PrefValueStore {
// indicates an error.
PrefStoreType ControllingPrefStoreForPref(const char* name) const;
- // Get a value from the specified store type.
+ // Get a value from the specified |store|.
bool GetValueFromStore(const char* name,
PrefStoreType store,
const Value** out_value) const;
+ // Get a value from the specified |store| if its |type| matches.
+ bool GetValueFromStoreWithType(const char* name,
+ base::Value::Type type,
+ PrefStoreType store,
+ const Value** out_value) const;
+
// Called upon changes in individual pref stores in order to determine whether
// the user-visible pref value has changed. Triggers the change notification
// if the effective value of the preference has changed, or if the store
« no previous file with comments | « chrome/browser/prefs/pref_service_unittest.cc ('k') | chrome/browser/prefs/pref_value_store.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698