Chromium Code Reviews| 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..0350e9170e6cf4ca99f12037142dac98d5bd91a2 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. |
| + kNoProxyServerMode = 0, |
|
Mattias Nissler (ping if slow)
2012/01/16 18:23:33
If you touch the enum, you might as well make the
Joao da Silva
2012/01/17 13:09:29
Done.
|
| + // Auto detect proxy or use specific PAC script if given. |
| + kAutoDetectProxyServerMode = 1, |
| + // Use manually configured proxy servers (fixed servers). |
| + kManuallyConfiguredProxyServerMode = 2, |
| + // Use system proxy server. |
| + kUseSystemProxyServerMode = 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 |