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

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

Issue 8480003: Surface error messages from ONC parsing in about:policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 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_

Powered by Google App Engine
This is Rietveld 408576698