| 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 797da3eea3b04338f3b43380605d7d53ced89ac7..965afdaa321c02c2a6200c8404a3966a24dcfc48 100644
|
| --- a/chrome/browser/policy/configuration_policy_handler.h
|
| +++ b/chrome/browser/policy/configuration_policy_handler.h
|
| @@ -9,6 +9,8 @@
|
| #include <vector>
|
|
|
| #include "base/basictypes.h"
|
| +#include "base/values.h"
|
| +#include "policy/configuration_policy_type.h"
|
|
|
| class PrefValueMap;
|
|
|
| @@ -46,6 +48,37 @@ class ConfigurationPolicyHandler {
|
| DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyHandler);
|
| };
|
|
|
| +// Abstract class derived from ConfigurationPolicyHandler that should be
|
| +// subclassed to handle a single policy (not a combination of policies).
|
| +class TypeCheckingPolicyHandler : public ConfigurationPolicyHandler {
|
| + public:
|
| + TypeCheckingPolicyHandler(ConfigurationPolicyType policy_type,
|
| + base::Value::Type value_type);
|
| +
|
| + // ConfigurationPolicyHandler methods:
|
| + virtual bool CheckPolicySettings(const PolicyMap* policies,
|
| + PolicyErrorMap* errors) OVERRIDE;
|
| +
|
| + protected:
|
| + virtual ~TypeCheckingPolicyHandler();
|
| +
|
| + // Runs policy checks and returns the policy value if successful.
|
| + bool CheckAndGetValue(const PolicyMap* policies,
|
| + PolicyErrorMap* errors,
|
| + const Value** value);
|
| +
|
| + ConfigurationPolicyType policy_type() const;
|
| +
|
| + private:
|
| + // The ConfigurationPolicyType of the policy.
|
| + ConfigurationPolicyType policy_type_;
|
| +
|
| + // The type the value of the policy should have.
|
| + base::Value::Type value_type_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(TypeCheckingPolicyHandler);
|
| +};
|
| +
|
| } // namespace policy
|
|
|
| #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_H_
|
|
|