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..62dec0f8dea6f427d35a50ab2c00187eecad2631 |
--- /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 |
+ |
+#include <string> |
+ |
+#include "base/memory/scoped_ptr.h" |
Mattias Nissler (ping if slow)
2011/09/20 13:12:25
not needed?
simo
2011/09/22 11:43:26
Done.
|
+#include "base/values.h" |
Mattias Nissler (ping if slow)
2011/09/20 13:12:25
not needed?
simo
2011/09/22 11:43:26
Done.
|
+#include "chrome/browser/policy/policy_error_map.h" |
Mattias Nissler (ping if slow)
2011/09/20 13:12:25
forward declaration?
simo
2011/09/22 11:43:26
Done.
|
+#include "chrome/browser/policy/policy_map.h" |
Mattias Nissler (ping if slow)
2011/09/20 13:12:25
forward declaration?
simo
2011/09/22 11:43:26
Done.
|
+#include "chrome/browser/prefs/pref_value_map.h" |
Mattias Nissler (ping if slow)
2011/09/20 13:12:25
forward declaration?
simo
2011/09/22 11:43:26
Done.
|
+ |
+namespace policy { |
+ |
+// 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 polic handled by this ConfigurationPolicyHandler is |
+ // valid and false otherwise, in which case |error_message| contains the |
+ // appropriate error message. |
+ virtual bool CheckPolicySettings(PolicyMap* map, PolicyErrorMap* errors) = 0; |
Mattias Nissler (ping if slow)
2011/09/20 13:12:25
Make the policy map const?
simo
2011/09/22 11:43:26
Done.
|
+ |
+ // Processes the policies handled by this ConfigurationPolicyHandler and sets |
+ // the appropriate preferences in |prefs|. |
+ virtual void ApplyPolicySettings(PolicyMap* map, PrefValueMap* prefs) = 0; |
Mattias Nissler (ping if slow)
2011/09/20 13:12:25
make the policy map const?
simo
2011/09/22 11:43:26
Done.
|
+ |
+ private: |
+ DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyHandlerInterface); |
+}; |
+ |
+} // namespace policy |
+ |
+#endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_INTERFACE_H_ |