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

Side by Side Diff: chrome/browser/policy/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
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698