OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_POLICY_HANDLER_H_ | 5 #ifndef COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_POLICY_HANDLER_H_ |
6 #define COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_POLICY_HANDLER_H_ | 6 #define COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_POLICY_HANDLER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "components/policy/core/browser/configuration_policy_handler.h" | 10 #include "components/policy/core/browser/configuration_policy_handler.h" |
11 | 11 |
12 namespace policy { | 12 namespace policy { |
13 | 13 |
14 // ConfigurationPolicyHandler for the DefaultSearchEncodings policy. | 14 // ConfigurationPolicyHandler for the DefaultSearchEncodings policy. |
15 class DefaultSearchEncodingsPolicyHandler | 15 class DefaultSearchEncodingsPolicyHandler |
16 : public TypeCheckingPolicyHandler { | 16 : public TypeCheckingPolicyHandler { |
17 public: | 17 public: |
18 DefaultSearchEncodingsPolicyHandler(); | 18 DefaultSearchEncodingsPolicyHandler(); |
19 virtual ~DefaultSearchEncodingsPolicyHandler(); | 19 virtual ~DefaultSearchEncodingsPolicyHandler(); |
20 | 20 |
21 // ConfigurationPolicyHandler methods: | 21 // ConfigurationPolicyHandler methods: |
22 virtual void ApplyPolicySettings(const PolicyMap& policies, | 22 virtual void ApplyPolicySettings(const PolicyMap& policies, |
23 PrefValueMap* prefs) OVERRIDE; | 23 PrefValueMap* prefs) override; |
24 | 24 |
25 private: | 25 private: |
26 DISALLOW_COPY_AND_ASSIGN(DefaultSearchEncodingsPolicyHandler); | 26 DISALLOW_COPY_AND_ASSIGN(DefaultSearchEncodingsPolicyHandler); |
27 }; | 27 }; |
28 | 28 |
29 // ConfigurationPolicyHandler for the default search policies. | 29 // ConfigurationPolicyHandler for the default search policies. |
30 class DefaultSearchPolicyHandler : public ConfigurationPolicyHandler { | 30 class DefaultSearchPolicyHandler : public ConfigurationPolicyHandler { |
31 public: | 31 public: |
32 DefaultSearchPolicyHandler(); | 32 DefaultSearchPolicyHandler(); |
33 virtual ~DefaultSearchPolicyHandler(); | 33 virtual ~DefaultSearchPolicyHandler(); |
34 | 34 |
35 // ConfigurationPolicyHandler methods: | 35 // ConfigurationPolicyHandler methods: |
36 virtual bool CheckPolicySettings(const PolicyMap& policies, | 36 virtual bool CheckPolicySettings(const PolicyMap& policies, |
37 PolicyErrorMap* errors) OVERRIDE; | 37 PolicyErrorMap* errors) override; |
38 virtual void ApplyPolicySettings(const PolicyMap& policies, | 38 virtual void ApplyPolicySettings(const PolicyMap& policies, |
39 PrefValueMap* prefs) OVERRIDE; | 39 PrefValueMap* prefs) override; |
40 | 40 |
41 private: | 41 private: |
42 void HandleDictionaryPref(const PolicyMap& policies, PrefValueMap* prefs); | 42 void HandleDictionaryPref(const PolicyMap& policies, PrefValueMap* prefs); |
43 | 43 |
44 // Calls |CheckPolicySettings()| on each of the handlers in |handlers_| | 44 // Calls |CheckPolicySettings()| on each of the handlers in |handlers_| |
45 // and returns whether all of the calls succeeded. | 45 // and returns whether all of the calls succeeded. |
46 bool CheckIndividualPolicies(const PolicyMap& policies, | 46 bool CheckIndividualPolicies(const PolicyMap& policies, |
47 PolicyErrorMap* errors); | 47 PolicyErrorMap* errors); |
48 | 48 |
49 // Returns whether there is a value for |policy_name| in |policies|. | 49 // Returns whether there is a value for |policy_name| in |policies|. |
(...skipping 22 matching lines...) Expand all Loading... |
72 | 72 |
73 // The ConfigurationPolicyHandler handlers for each default search policy. | 73 // The ConfigurationPolicyHandler handlers for each default search policy. |
74 std::vector<TypeCheckingPolicyHandler*> handlers_; | 74 std::vector<TypeCheckingPolicyHandler*> handlers_; |
75 | 75 |
76 DISALLOW_COPY_AND_ASSIGN(DefaultSearchPolicyHandler); | 76 DISALLOW_COPY_AND_ASSIGN(DefaultSearchPolicyHandler); |
77 }; | 77 }; |
78 | 78 |
79 } // namespace policy | 79 } // namespace policy |
80 | 80 |
81 #endif // COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_POLICY_HANDLER_H_ | 81 #endif // COMPONENTS_SEARCH_ENGINES_DEFAULT_SEARCH_POLICY_HANDLER_H_ |
OLD | NEW |