OLD | NEW |
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_CHROMEOS_POLICY_CONFIGURATION_POLICY_HANDLER_CHROMEOS_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_POLICY_CONFIGURATION_POLICY_HANDLER_CHROMEOS_H_ |
6 #define CHROME_BROWSER_CHROMEOS_POLICY_CONFIGURATION_POLICY_HANDLER_CHROMEOS_H_ | 6 #define CHROME_BROWSER_CHROMEOS_POLICY_CONFIGURATION_POLICY_HANDLER_CHROMEOS_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "chrome/browser/extensions/policy_handlers.h" | 10 #include "chrome/browser/extensions/policy_handlers.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 class Schema; | 22 class Schema; |
23 | 23 |
24 // ConfigurationPolicyHandler for policies referencing external data. | 24 // ConfigurationPolicyHandler for policies referencing external data. |
25 class ExternalDataPolicyHandler : public TypeCheckingPolicyHandler { | 25 class ExternalDataPolicyHandler : public TypeCheckingPolicyHandler { |
26 public: | 26 public: |
27 explicit ExternalDataPolicyHandler(const char* policy_name); | 27 explicit ExternalDataPolicyHandler(const char* policy_name); |
28 virtual ~ExternalDataPolicyHandler(); | 28 virtual ~ExternalDataPolicyHandler(); |
29 | 29 |
30 // TypeCheckingPolicyHandler: | 30 // TypeCheckingPolicyHandler: |
31 virtual bool CheckPolicySettings(const PolicyMap& policies, | 31 virtual bool CheckPolicySettings(const PolicyMap& policies, |
32 PolicyErrorMap* errors) OVERRIDE; | 32 PolicyErrorMap* errors) override; |
33 | 33 |
34 virtual void ApplyPolicySettings(const PolicyMap& policies, | 34 virtual void ApplyPolicySettings(const PolicyMap& policies, |
35 PrefValueMap* prefs) OVERRIDE; | 35 PrefValueMap* prefs) override; |
36 | 36 |
37 private: | 37 private: |
38 DISALLOW_COPY_AND_ASSIGN(ExternalDataPolicyHandler); | 38 DISALLOW_COPY_AND_ASSIGN(ExternalDataPolicyHandler); |
39 }; | 39 }; |
40 | 40 |
41 // ConfigurationPolicyHandler for validation of the network configuration | 41 // ConfigurationPolicyHandler for validation of the network configuration |
42 // policies. These actually don't set any preferences, but the handler just | 42 // policies. These actually don't set any preferences, but the handler just |
43 // generates error messages. | 43 // generates error messages. |
44 class NetworkConfigurationPolicyHandler : public TypeCheckingPolicyHandler { | 44 class NetworkConfigurationPolicyHandler : public TypeCheckingPolicyHandler { |
45 public: | 45 public: |
46 static NetworkConfigurationPolicyHandler* CreateForUserPolicy(); | 46 static NetworkConfigurationPolicyHandler* CreateForUserPolicy(); |
47 static NetworkConfigurationPolicyHandler* CreateForDevicePolicy(); | 47 static NetworkConfigurationPolicyHandler* CreateForDevicePolicy(); |
48 | 48 |
49 virtual ~NetworkConfigurationPolicyHandler(); | 49 virtual ~NetworkConfigurationPolicyHandler(); |
50 | 50 |
51 // ConfigurationPolicyHandler methods: | 51 // ConfigurationPolicyHandler methods: |
52 virtual bool CheckPolicySettings(const PolicyMap& policies, | 52 virtual bool CheckPolicySettings(const PolicyMap& policies, |
53 PolicyErrorMap* errors) OVERRIDE; | 53 PolicyErrorMap* errors) override; |
54 virtual void ApplyPolicySettings(const PolicyMap& policies, | 54 virtual void ApplyPolicySettings(const PolicyMap& policies, |
55 PrefValueMap* prefs) OVERRIDE; | 55 PrefValueMap* prefs) override; |
56 virtual void PrepareForDisplaying(PolicyMap* policies) const OVERRIDE; | 56 virtual void PrepareForDisplaying(PolicyMap* policies) const override; |
57 | 57 |
58 private: | 58 private: |
59 explicit NetworkConfigurationPolicyHandler( | 59 explicit NetworkConfigurationPolicyHandler( |
60 const char* policy_name, | 60 const char* policy_name, |
61 ::onc::ONCSource onc_source, | 61 ::onc::ONCSource onc_source, |
62 const char* pref_path); | 62 const char* pref_path); |
63 | 63 |
64 // Takes network policy in Value representation and produces an output Value | 64 // Takes network policy in Value representation and produces an output Value |
65 // that contains a pretty-printed and sanitized version. In particular, we | 65 // that contains a pretty-printed and sanitized version. In particular, we |
66 // remove any Passphrases that may be contained in the JSON. Ownership of the | 66 // remove any Passphrases that may be contained in the JSON. Ownership of the |
(...skipping 12 matching lines...) Expand all Loading... |
79 | 79 |
80 // Maps the PinnedLauncherApps policy to the corresponding pref. | 80 // Maps the PinnedLauncherApps policy to the corresponding pref. |
81 class PinnedLauncherAppsPolicyHandler | 81 class PinnedLauncherAppsPolicyHandler |
82 : public extensions::ExtensionListPolicyHandler { | 82 : public extensions::ExtensionListPolicyHandler { |
83 public: | 83 public: |
84 PinnedLauncherAppsPolicyHandler(); | 84 PinnedLauncherAppsPolicyHandler(); |
85 virtual ~PinnedLauncherAppsPolicyHandler(); | 85 virtual ~PinnedLauncherAppsPolicyHandler(); |
86 | 86 |
87 // ExtensionListPolicyHandler methods: | 87 // ExtensionListPolicyHandler methods: |
88 virtual void ApplyPolicySettings(const PolicyMap& policies, | 88 virtual void ApplyPolicySettings(const PolicyMap& policies, |
89 PrefValueMap* prefs) OVERRIDE; | 89 PrefValueMap* prefs) override; |
90 | 90 |
91 private: | 91 private: |
92 DISALLOW_COPY_AND_ASSIGN(PinnedLauncherAppsPolicyHandler); | 92 DISALLOW_COPY_AND_ASSIGN(PinnedLauncherAppsPolicyHandler); |
93 }; | 93 }; |
94 | 94 |
95 class ScreenMagnifierPolicyHandler : public IntRangePolicyHandlerBase { | 95 class ScreenMagnifierPolicyHandler : public IntRangePolicyHandlerBase { |
96 public: | 96 public: |
97 ScreenMagnifierPolicyHandler(); | 97 ScreenMagnifierPolicyHandler(); |
98 virtual ~ScreenMagnifierPolicyHandler(); | 98 virtual ~ScreenMagnifierPolicyHandler(); |
99 | 99 |
100 // IntRangePolicyHandlerBase: | 100 // IntRangePolicyHandlerBase: |
101 virtual void ApplyPolicySettings(const PolicyMap& policies, | 101 virtual void ApplyPolicySettings(const PolicyMap& policies, |
102 PrefValueMap* prefs) OVERRIDE; | 102 PrefValueMap* prefs) override; |
103 | 103 |
104 private: | 104 private: |
105 DISALLOW_COPY_AND_ASSIGN(ScreenMagnifierPolicyHandler); | 105 DISALLOW_COPY_AND_ASSIGN(ScreenMagnifierPolicyHandler); |
106 }; | 106 }; |
107 | 107 |
108 // Policy handler for login screen power management settings. This does not | 108 // Policy handler for login screen power management settings. This does not |
109 // actually set any prefs, it just checks whether the settings are valid and | 109 // actually set any prefs, it just checks whether the settings are valid and |
110 // generates errors if appropriate. | 110 // generates errors if appropriate. |
111 class LoginScreenPowerManagementPolicyHandler | 111 class LoginScreenPowerManagementPolicyHandler |
112 : public SchemaValidatingPolicyHandler { | 112 : public SchemaValidatingPolicyHandler { |
113 public: | 113 public: |
114 explicit LoginScreenPowerManagementPolicyHandler(const Schema& chrome_schema); | 114 explicit LoginScreenPowerManagementPolicyHandler(const Schema& chrome_schema); |
115 virtual ~LoginScreenPowerManagementPolicyHandler(); | 115 virtual ~LoginScreenPowerManagementPolicyHandler(); |
116 | 116 |
117 // SchemaValidatingPolicyHandler: | 117 // SchemaValidatingPolicyHandler: |
118 virtual void ApplyPolicySettings(const PolicyMap& policies, | 118 virtual void ApplyPolicySettings(const PolicyMap& policies, |
119 PrefValueMap* prefs) OVERRIDE; | 119 PrefValueMap* prefs) override; |
120 | 120 |
121 private: | 121 private: |
122 DISALLOW_COPY_AND_ASSIGN(LoginScreenPowerManagementPolicyHandler); | 122 DISALLOW_COPY_AND_ASSIGN(LoginScreenPowerManagementPolicyHandler); |
123 }; | 123 }; |
124 | 124 |
125 // Handles the deprecated IdleAction policy, so both kIdleActionBattery and | 125 // Handles the deprecated IdleAction policy, so both kIdleActionBattery and |
126 // kIdleActionAC fall back to the deprecated action. | 126 // kIdleActionAC fall back to the deprecated action. |
127 class DeprecatedIdleActionHandler : public IntRangePolicyHandlerBase { | 127 class DeprecatedIdleActionHandler : public IntRangePolicyHandlerBase { |
128 public: | 128 public: |
129 DeprecatedIdleActionHandler(); | 129 DeprecatedIdleActionHandler(); |
130 virtual ~DeprecatedIdleActionHandler(); | 130 virtual ~DeprecatedIdleActionHandler(); |
131 | 131 |
132 // ConfigurationPolicyHandler methods: | 132 // ConfigurationPolicyHandler methods: |
133 virtual void ApplyPolicySettings(const PolicyMap& policies, | 133 virtual void ApplyPolicySettings(const PolicyMap& policies, |
134 PrefValueMap* prefs) OVERRIDE; | 134 PrefValueMap* prefs) override; |
135 | 135 |
136 private: | 136 private: |
137 DISALLOW_COPY_AND_ASSIGN(DeprecatedIdleActionHandler); | 137 DISALLOW_COPY_AND_ASSIGN(DeprecatedIdleActionHandler); |
138 }; | 138 }; |
139 | 139 |
140 class PowerManagementIdleSettingsPolicyHandler | 140 class PowerManagementIdleSettingsPolicyHandler |
141 : public SchemaValidatingPolicyHandler { | 141 : public SchemaValidatingPolicyHandler { |
142 public: | 142 public: |
143 explicit PowerManagementIdleSettingsPolicyHandler( | 143 explicit PowerManagementIdleSettingsPolicyHandler( |
144 const Schema& chrome_schema); | 144 const Schema& chrome_schema); |
145 virtual ~PowerManagementIdleSettingsPolicyHandler(); | 145 virtual ~PowerManagementIdleSettingsPolicyHandler(); |
146 | 146 |
147 // SchemaValidatingPolicyHandler: | 147 // SchemaValidatingPolicyHandler: |
148 virtual void ApplyPolicySettings(const PolicyMap& policies, | 148 virtual void ApplyPolicySettings(const PolicyMap& policies, |
149 PrefValueMap* prefs) OVERRIDE; | 149 PrefValueMap* prefs) override; |
150 | 150 |
151 private: | 151 private: |
152 DISALLOW_COPY_AND_ASSIGN(PowerManagementIdleSettingsPolicyHandler); | 152 DISALLOW_COPY_AND_ASSIGN(PowerManagementIdleSettingsPolicyHandler); |
153 }; | 153 }; |
154 | 154 |
155 class ScreenLockDelayPolicyHandler : public SchemaValidatingPolicyHandler { | 155 class ScreenLockDelayPolicyHandler : public SchemaValidatingPolicyHandler { |
156 public: | 156 public: |
157 explicit ScreenLockDelayPolicyHandler(const Schema& chrome_schema); | 157 explicit ScreenLockDelayPolicyHandler(const Schema& chrome_schema); |
158 virtual ~ScreenLockDelayPolicyHandler(); | 158 virtual ~ScreenLockDelayPolicyHandler(); |
159 | 159 |
160 // SchemaValidatingPolicyHandler: | 160 // SchemaValidatingPolicyHandler: |
161 virtual void ApplyPolicySettings(const PolicyMap& policies, | 161 virtual void ApplyPolicySettings(const PolicyMap& policies, |
162 PrefValueMap* prefs) OVERRIDE; | 162 PrefValueMap* prefs) override; |
163 | 163 |
164 private: | 164 private: |
165 DISALLOW_COPY_AND_ASSIGN(ScreenLockDelayPolicyHandler); | 165 DISALLOW_COPY_AND_ASSIGN(ScreenLockDelayPolicyHandler); |
166 }; | 166 }; |
167 | 167 |
168 } // namespace policy | 168 } // namespace policy |
169 | 169 |
170 #endif // CHROME_BROWSER_CHROMEOS_POLICY_CONFIGURATION_POLICY_HANDLER_CHROMEOS_
H_ | 170 #endif // CHROME_BROWSER_CHROMEOS_POLICY_CONFIGURATION_POLICY_HANDLER_CHROMEOS_
H_ |
OLD | NEW |