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

Unified Diff: chrome/browser/policy/configuration_policy_handler.h

Issue 9111022: Removed ConfigurationPolicyType and extended PolicyMap. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased Created 8 years, 11 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: chrome/browser/policy/configuration_policy_handler.h
diff --git a/chrome/browser/policy/configuration_policy_handler.h b/chrome/browser/policy/configuration_policy_handler.h
index 59706ee77dd68d5dac210742ba6ce4f4e7643eea..a546aeee4ac388d68ffb592f1939a4982ca0cf8a 100644
--- a/chrome/browser/policy/configuration_policy_handler.h
+++ b/chrome/browser/policy/configuration_policy_handler.h
@@ -11,7 +11,6 @@
#include "base/basictypes.h"
#include "base/values.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
-#include "policy/configuration_policy_type.h"
class PrefValueMap;
@@ -54,7 +53,7 @@ class ConfigurationPolicyHandler {
// subclassed to handle a single policy (not a combination of policies).
class TypeCheckingPolicyHandler : public ConfigurationPolicyHandler {
public:
- TypeCheckingPolicyHandler(ConfigurationPolicyType policy_type,
+ TypeCheckingPolicyHandler(const char* policy_name,
base::Value::Type value_type);
// ConfigurationPolicyHandler methods:
@@ -69,11 +68,11 @@ class TypeCheckingPolicyHandler : public ConfigurationPolicyHandler {
PolicyErrorMap* errors,
const Value** value);
- ConfigurationPolicyType policy_type() const;
+ const char* policy_name() const;
private:
- // The ConfigurationPolicyType of the policy.
- ConfigurationPolicyType policy_type_;
+ // The name of the policy.
+ const char* policy_name_;
// The type the value of the policy should have.
base::Value::Type value_type_;
@@ -84,9 +83,9 @@ class TypeCheckingPolicyHandler : public ConfigurationPolicyHandler {
// ConfigurationPolicyHandler for policies that map directly to a preference.
class SimplePolicyHandler : public TypeCheckingPolicyHandler {
public:
- SimplePolicyHandler(ConfigurationPolicyType policy_type,
- base::Value::Type value_type,
- const char* pref_path);
+ SimplePolicyHandler(const char* policy_name,
+ const char* pref_path,
+ base::Value::Type value_type);
virtual ~SimplePolicyHandler();
// ConfigurationPolicyHandler methods:
@@ -221,10 +220,10 @@ class DefaultSearchPolicyHandler : public ConfigurationPolicyHandler {
bool CheckIndividualPolicies(const PolicyMap& policies,
PolicyErrorMap* errors);
- // Returns true if there is a value for |policy_type| in |policies| and false
+ // Returns true if there is a value for |policy_name| in |policies| and false
// otherwise.
bool HasDefaultSearchPolicy(const PolicyMap& policies,
- ConfigurationPolicyType policy_type);
+ const char* policy_name);
// Returns true if any default search policies are specified in |policies| and
// false otherwise.
@@ -251,6 +250,24 @@ class DefaultSearchPolicyHandler : public ConfigurationPolicyHandler {
// ConfigurationPolicyHandler for the proxy policies.
class ProxyPolicyHandler : public ConfigurationPolicyHandler {
public:
+ // Constants for the "Proxy Server Mode" defined in the policies.
+ // Note that these diverge from internal presentation defined in
+ // ProxyPrefs::ProxyMode for legacy reasons. The following four
+ // PolicyProxyModeType types were not very precise and had overlapping use
+ // cases.
+ enum ProxyModeType {
+ // Disable Proxy, connect directly.
+ PROXY_SERVER_MODE = 0,
+ // Auto detect proxy or use specific PAC script if given.
+ PROXY_AUTO_DETECT_PROXY_SERVER_MODE = 1,
+ // Use manually configured proxy servers (fixed servers).
+ PROXY_MANUALLY_CONFIGURED_PROXY_SERVER_MODE = 2,
+ // Use system proxy server.
+ PROXY_USE_SYSTEM_PROXY_SERVER_MODE = 3,
+
+ MODE_COUNT
+ };
+
ProxyPolicyHandler();
virtual ~ProxyPolicyHandler();
@@ -262,7 +279,7 @@ class ProxyPolicyHandler : public ConfigurationPolicyHandler {
private:
const Value* GetProxyPolicyValue(const PolicyMap& policies,
- ConfigurationPolicyType policy);
+ const char* policy_name);
// Converts the deprecated ProxyServerMode policy value to a ProxyMode value
// and places the result in |mode_value|. Returns true if the conversion
« no previous file with comments | « chrome/browser/policy/config_dir_policy_provider_unittest.cc ('k') | chrome/browser/policy/configuration_policy_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698