summaryrefslogtreecommitdiffstats
path: root/chrome/common/pref_store.h
diff options
context:
space:
mode:
authordanno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-15 08:40:58 +0000
committerdanno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-10-15 08:40:58 +0000
commitce1850e90e8472a05fd9efdb8379c0d399d0be78 (patch)
tree4d1c28169195a01381d23fac5b07187f0ef7ab25 /chrome/common/pref_store.h
parent817b6121b50d77b2eacc5ce594cc20fe4fddef6d (diff)
downloadchromium_src-ce1850e90e8472a05fd9efdb8379c0d399d0be78.zip
chromium_src-ce1850e90e8472a05fd9efdb8379c0d399d0be78.tar.gz
chromium_src-ce1850e90e8472a05fd9efdb8379c0d399d0be78.tar.bz2
When a proxy command line switches are specified, policy admin warning shouldn't be shown
Removed the logic from the ConfigurationPolicyPrefStore that sets managed preferences, it's now completely handled by CommandLinePrefStore. Moved the detection of conflicting proxy settings between the managed and other stores into the PrefValueStore. Implemented a sentinel value that can be used by stores to signal that they are returning the default value. Changed managed store to use this sentinel to hide non-managed proxy settings proxy settings when proxy policy is specified. BUG=54792 TEST=manual Review URL: http://codereview.chromium.org/3367021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@62716 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/pref_store.h')
-rw-r--r--chrome/common/pref_store.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/chrome/common/pref_store.h b/chrome/common/pref_store.h
index 727c020..192ce14 100644
--- a/chrome/common/pref_store.h
+++ b/chrome/common/pref_store.h
@@ -7,6 +7,7 @@
#pragma once
class DictionaryValue;
+class Value;
// This is an abstract interface for reading and writing from/to a persistent
// preference store, used by |PrefService|. An implementation using a JSON file
@@ -31,6 +32,18 @@ class PrefStore {
PREF_READ_ERROR_FILE_NOT_SPECIFIED
};
+ // To require that the default value be used for a preference, a
+ // PrefStore can set the value in its own prefs dictionary to the
+ // sentinel Value returned by this function.
+ // TODO(danno): Instead of having a sentinel value, pref stores
+ // should return a richer set of information from the property
+ // accessor methods to indicate that the default should be used.
+ static Value* CreateUseDefaultSentinelValue();
+
+ // Returns true if a value is the special sentinel value created by
+ // CreateUseDefaultSentinelValue.
+ static bool IsUseDefaultSentinelValue(Value* value);
+
virtual ~PrefStore() { }
// Whether the store is in a pseudo-read-only mode where changes are not
@@ -38,6 +51,10 @@ class PrefStore {
// read errors during startup.
virtual bool ReadOnly() { return true; }
+ // TODO(danno): PrefValueStore shouldn't allow direct access to the
+ // DictionaryValue. Instead, it should have getters that return a
+ // richer set of information for a pref, including if the store
+ // wants to return the default value for a preference.
virtual DictionaryValue* prefs() = 0;
virtual PrefReadError ReadPrefs() = 0;