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

Side by Side Diff: components/policy/core/browser/configuration_policy_handler_list.h

Issue 109743002: Move policy code into components/policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moar fixes Created 7 years 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_LIST_H_ 5 #ifndef COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_LIST_H_
6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_LIST_H_ 6 #define COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_LIST_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
11 #include "base/callback.h" 11 #include "base/callback.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "components/policy/core/common/policy_details.h" 13 #include "components/policy/core/common/policy_details.h"
14 #include "components/policy/policy_export.h"
14 15
15 class PrefValueMap; 16 class PrefValueMap;
16 17
17 namespace policy { 18 namespace policy {
18 19
19 class ConfigurationPolicyHandler; 20 class ConfigurationPolicyHandler;
20 class PolicyErrorMap; 21 class PolicyErrorMap;
21 class PolicyMap; 22 class PolicyMap;
22 struct PolicyToPreferenceMapEntry; 23 struct PolicyToPreferenceMapEntry;
23 24
24 // Converts policies to their corresponding preferences by applying a list of 25 // Converts policies to their corresponding preferences by applying a list of
25 // ConfigurationPolicyHandler objects. This includes error checking and 26 // ConfigurationPolicyHandler objects. This includes error checking and
26 // cleaning up policy values for displaying. 27 // cleaning up policy values for displaying.
27 class ConfigurationPolicyHandlerList { 28 class POLICY_EXPORT ConfigurationPolicyHandlerList {
28 public: 29 public:
29 explicit ConfigurationPolicyHandlerList( 30 explicit ConfigurationPolicyHandlerList(
30 const GetChromePolicyDetailsCallback& details_callback); 31 const GetChromePolicyDetailsCallback& details_callback);
31 ~ConfigurationPolicyHandlerList(); 32 ~ConfigurationPolicyHandlerList();
32 33
33 // Adds a policy handler to the list. 34 // Adds a policy handler to the list.
34 void AddHandler(scoped_ptr<ConfigurationPolicyHandler> handler); 35 void AddHandler(scoped_ptr<ConfigurationPolicyHandler> handler);
35 36
36 // Translates |policies| to their corresponding preferences in |prefs|. 37 // Translates |policies| to their corresponding preferences in |prefs|.
37 // Any errors found while processing the policies are stored in |errors|. 38 // 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 // |prefs| or |errors| can be NULL, and won't be filled in that case.
39 void ApplyPolicySettings(const PolicyMap& policies, 40 void ApplyPolicySettings(const PolicyMap& policies,
40 PrefValueMap* prefs, 41 PrefValueMap* prefs,
41 PolicyErrorMap* errors) const; 42 PolicyErrorMap* errors) const;
42 43
43 // Converts sensitive policy values to others more appropriate for displaying. 44 // Converts sensitive policy values to others more appropriate for displaying.
44 void PrepareForDisplaying(PolicyMap* policies) const; 45 void PrepareForDisplaying(PolicyMap* policies) const;
45 46
46 private: 47 private:
47 std::vector<ConfigurationPolicyHandler*> handlers_; 48 std::vector<ConfigurationPolicyHandler*> handlers_;
48 GetChromePolicyDetailsCallback details_callback_; 49 GetChromePolicyDetailsCallback details_callback_;
49 50
50 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyHandlerList); 51 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyHandlerList);
51 }; 52 };
52 53
53 } // namespace policy 54 } // namespace policy
54 55
55 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_HANDLER_LIST_H_ 56 #endif // COMPONENTS_POLICY_CORE_BROWSER_CONFIGURATION_POLICY_HANDLER_LIST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698