OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_H_ |
| 6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_H_ |
| 7 #pragma once |
| 8 |
| 9 #include <vector> |
| 10 |
| 11 #include "base/basictypes.h" |
| 12 |
| 13 class PrefValueMap; |
| 14 |
| 15 namespace policy { |
| 16 |
| 17 class PolicyErrorMap; |
| 18 class PolicyMap; |
| 19 |
| 20 // An abstract super class that subclasses should implement to map policies to |
| 21 // their corresponding preferences, and to check whether the policies are valid. |
| 22 class ConfigurationPolicyHandler { |
| 23 public: |
| 24 typedef std::vector<ConfigurationPolicyHandler*> HandlerList; |
| 25 |
| 26 ConfigurationPolicyHandler() {} |
| 27 virtual ~ConfigurationPolicyHandler() {} |
| 28 |
| 29 // Returns true if the policy settings handled by this |
| 30 // ConfigurationPolicyHandler can be applied and false otherwise. Fills |
| 31 // |errors| with error messages or warnings. |errors| may contain error |
| 32 // messages even when |CheckPolicySettings()| returns true. |
| 33 virtual bool CheckPolicySettings(const PolicyMap* policies, |
| 34 PolicyErrorMap* errors) = 0; |
| 35 |
| 36 // Processes the policies handled by this ConfigurationPolicyHandler and sets |
| 37 // the appropriate preferences in |prefs|. |
| 38 virtual void ApplyPolicySettings(const PolicyMap* policies, |
| 39 PrefValueMap* prefs) = 0; |
| 40 |
| 41 // Creates a new HandlerList with all the known handlers and returns it. |
| 42 // The new list and its elements are owned by the caller. |
| 43 static HandlerList* CreateHandlerList(); |
| 44 |
| 45 private: |
| 46 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyHandler); |
| 47 }; |
| 48 |
| 49 } // namespace policy |
| 50 |
| 51 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_H_ |
OLD | NEW |