summaryrefslogtreecommitdiffstats
path: root/chrome/browser/pref_value_store.h
diff options
context:
space:
mode:
authormnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-21 13:54:08 +0000
committermnissler@chromium.org <mnissler@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-21 13:54:08 +0000
commit74379bc51320fd98a47c98053a056b4ddd7271a7 (patch)
tree721fb4cbad36a304162745d8a0a5ee0930f054f0 /chrome/browser/pref_value_store.h
parent7082b2329218da9a77fd6bc9587e86d0ed817196 (diff)
downloadchromium_src-74379bc51320fd98a47c98053a056b4ddd7271a7.zip
chromium_src-74379bc51320fd98a47c98053a056b4ddd7271a7.tar.gz
chromium_src-74379bc51320fd98a47c98053a056b4ddd7271a7.tar.bz2
Adjust preference sync code to only sync user modifiable preferences.
Switch to the new preference value source checkers in Preference. While at it, add a unit test and better test infrastructure for controlling preference values in tests. Convert existing unit tests where appropriate. BUG=48952 TEST=ProfileSyncServicePreferenceTest.ManagedPreferences Review URL: http://codereview.chromium.org/3051001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@53179 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/pref_value_store.h')
-rw-r--r--chrome/browser/pref_value_store.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/chrome/browser/pref_value_store.h b/chrome/browser/pref_value_store.h
index 885b7c0..9dcce64 100644
--- a/chrome/browser/pref_value_store.h
+++ b/chrome/browser/pref_value_store.h
@@ -96,9 +96,16 @@ class PrefValueStore {
bool PrefValueFromExtensionStore(const wchar_t* name);
bool PrefValueFromUserStore(const wchar_t* name);
+ // Check whether a Preference value is modifiable by the user, i.e. whether
+ // there is no higher-priority source controlling it.
+ bool PrefValueUserModifiable(const wchar_t* name);
+
private:
// PrefStores must be listed here in order from highest to lowest priority.
enum PrefStoreType {
+ // Not associated with an actual PrefStore but used as invalid marker, e.g.
+ // as return value.
+ INVALID = -1,
MANAGED = 0,
EXTENSION,
COMMAND_LINE,
@@ -111,7 +118,10 @@ class PrefValueStore {
bool PrefValueInStore(const wchar_t* name, PrefStoreType type);
- bool PrefValueFromStore(const wchar_t* name, PrefStoreType type);
+ // Returns the pref store type identifying the source that controls the
+ // Preference identified by |name|. If none of the sources has a value,
+ // INVALID is returned.
+ PrefStoreType ControllingPrefStoreForPref(const wchar_t* name);
DISALLOW_COPY_AND_ASSIGN(PrefValueStore);
};