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 a policy | |
21 // configuration to the appropriate preferences and to check whether a policy | |
22 // configuration is valid. | |
Mattias Nissler (ping if slow)
2011/10/11 11:10:57
suggestion: s/configuration/setting/?
Joao da Silva
2011/10/11 15:09:23
Agreed. Rewrote the comment.
| |
23 class ConfigurationPolicyHandler { | |
24 public: | |
25 typedef std::vector<ConfigurationPolicyHandler*> HandlerList; | |
26 | |
27 ConfigurationPolicyHandler() {} | |
28 virtual ~ConfigurationPolicyHandler() {} | |
29 | |
30 // Returns true if the policy settings handled by this | |
31 // ConfigurationPolicyHandler can be applied and false otherwise. Fills | |
32 // |errors| with error messages or warnings. |errors| may contain error | |
33 // messages even when |CheckPolicySettings()| returns true. | |
34 virtual bool CheckPolicySettings(const PolicyMap* policies, | |
35 PolicyErrorMap* errors) = 0; | |
36 | |
37 // Processes the policies handled by this ConfigurationPolicyHandler and sets | |
38 // the appropriate preferences in |prefs|. | |
39 virtual void ApplyPolicySettings(const PolicyMap* policies, | |
40 PrefValueMap* prefs) = 0; | |
41 | |
42 // Creates a new HandlerList with all the known handlers and returns it. | |
43 // The new list and its elements are owned by the caller. | |
44 static HandlerList* CreateHandlerList(); | |
45 | |
46 private: | |
47 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyHandler); | |
48 }; | |
49 | |
50 } // namespace policy | |
51 | |
52 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_H_ | |
OLD | NEW |