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

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

Issue 7972013: ConfigurationPolicyPrefStore refactoring to surface error messages. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: . Created 9 years, 3 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_interface.h
diff --git a/chrome/browser/policy/configuration_policy_handler_interface.h b/chrome/browser/policy/configuration_policy_handler_interface.h
new file mode 100644
index 0000000000000000000000000000000000000000..7c2cf157a6f3f27912e1e1e0fca03128616481ef
--- /dev/null
+++ b/chrome/browser/policy/configuration_policy_handler_interface.h
@@ -0,0 +1,42 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_INTERFACE_H_
+#define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_INTERFACE_H_
+#pragma once
+
+class PrefValueMap;
+
+namespace policy {
+
+class PolicyErrorMap;
+class PolicyMap;
+
+// An abstract super class that subclasses should implement to map a policy
+// configuration to the appropriate preferences and to check whether a policy
+// configuration is valid.
+class ConfigurationPolicyHandlerInterface {
+ public:
+ ConfigurationPolicyHandlerInterface() {}
+ virtual ~ConfigurationPolicyHandlerInterface() {}
+
+ // Returns true if the policy settings handled by this
+ // ConfigurationPolicyHandler can be applied and false otherwise. Fills
+ // |errors| with error messages or warnings. |errors| may contain error
+ // messages even when |CheckPolicySettings()| returns true.
+ virtual bool CheckPolicySettings(const PolicyMap* policies,
+ PolicyErrorMap* errors) = 0;
+
+ // Processes the policies handled by this ConfigurationPolicyHandler and sets
+ // the appropriate preferences in |prefs|.
+ virtual void ApplyPolicySettings(const PolicyMap* policies,
+ PrefValueMap* prefs) = 0;
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyHandlerInterface);
+};
+
+} // namespace policy
+
+#endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_INTERFACE_H_

Powered by Google App Engine
This is Rietveld 408576698