| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2012 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_LIST_H_ | |
| 6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_LIST_H_ | |
| 7 | |
| 8 #include <vector> | |
| 9 | |
| 10 #include "base/basictypes.h" | |
| 11 #include "base/callback.h" | |
| 12 #include "base/memory/scoped_ptr.h" | |
| 13 #include "components/policy/core/common/policy_details.h" | |
| 14 | |
| 15 class PrefValueMap; | |
| 16 | |
| 17 namespace policy { | |
| 18 | |
| 19 class ConfigurationPolicyHandler; | |
| 20 class PolicyErrorMap; | |
| 21 class PolicyMap; | |
| 22 struct PolicyToPreferenceMapEntry; | |
| 23 | |
| 24 // Converts policies to their corresponding preferences by applying a list of | |
| 25 // ConfigurationPolicyHandler objects. This includes error checking and | |
| 26 // cleaning up policy values for displaying. | |
| 27 class ConfigurationPolicyHandlerList { | |
| 28 public: | |
| 29 explicit ConfigurationPolicyHandlerList( | |
| 30 const GetChromePolicyDetailsCallback& details_callback); | |
| 31 ~ConfigurationPolicyHandlerList(); | |
| 32 | |
| 33 // Adds a policy handler to the list. | |
| 34 void AddHandler(scoped_ptr<ConfigurationPolicyHandler> handler); | |
| 35 | |
| 36 // Translates |policies| to their corresponding preferences in |prefs|. | |
| 37 // Any errors found while processing the policies are stored in |errors|. | |
| 38 // |prefs| or |errors| can be NULL, and won't be filled in that case. | |
| 39 void ApplyPolicySettings(const PolicyMap& policies, | |
| 40 PrefValueMap* prefs, | |
| 41 PolicyErrorMap* errors) const; | |
| 42 | |
| 43 // Converts sensitive policy values to others more appropriate for displaying. | |
| 44 void PrepareForDisplaying(PolicyMap* policies) const; | |
| 45 | |
| 46 private: | |
| 47 std::vector<ConfigurationPolicyHandler*> handlers_; | |
| 48 GetChromePolicyDetailsCallback details_callback_; | |
| 49 | |
| 50 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyHandlerList); | |
| 51 }; | |
| 52 | |
| 53 } // namespace policy | |
| 54 | |
| 55 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_LIST_H_ | |
| OLD | NEW |