OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_CONFIGURATION_POLICY_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_CONFIGURATION_POLICY_PROVIDER_H_ |
6 #define CHROME_BROWSER_CONFIGURATION_POLICY_PROVIDER_H_ | 6 #define CHROME_BROWSER_CONFIGURATION_POLICY_PROVIDER_H_ |
7 | 7 |
| 8 #include "base/basictypes.h" |
| 9 |
8 class ConfigurationPolicyStore; | 10 class ConfigurationPolicyStore; |
| 11 class DictionaryValue; |
9 | 12 |
10 // An abstract super class for platform-specific policy providers. | 13 // An abstract super class for platform-specific policy providers. |
11 // Platform-specific policy providers (Windows Group Policy, gconf, | 14 // Platform-specific policy providers (Windows Group Policy, gconf, |
12 // etc.) should implement a subclass of this class. | 15 // etc.) should implement a subclass of this class. |
13 class ConfigurationPolicyProvider { | 16 class ConfigurationPolicyProvider { |
14 public: | 17 public: |
15 ConfigurationPolicyProvider(); | 18 ConfigurationPolicyProvider() {} |
16 virtual ~ConfigurationPolicyProvider() {} | 19 virtual ~ConfigurationPolicyProvider() {} |
17 | 20 |
18 // Must be implemented by provider subclasses to specify the | 21 // Must be implemented by provider subclasses to specify the |
19 // provider-specific policy decisions. The preference service | 22 // provider-specific policy decisions. The preference service |
20 // invokes this |Provide| method when it needs a policy | 23 // invokes this |Provide| method when it needs a policy |
21 // provider to specify its policy choices. In |Provide|, | 24 // provider to specify its policy choices. In |Provide|, |
22 // the |ConfigurationPolicyProvider| must make calls to the | 25 // the ConfigurationPolicyProvider must make calls to the |
23 // |Apply| method of |store| to apply specific policies. | 26 // |Apply| method of |store| to apply specific policies. |
24 // Returns true if the policy could be provided, otherwise false. | 27 // Returns true if the policy could be provided, otherwise false. |
25 virtual bool Provide(ConfigurationPolicyStore* store) = 0; | 28 virtual bool Provide(ConfigurationPolicyStore* store) = 0; |
26 | 29 |
27 private: | 30 private: |
28 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyProvider); | 31 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyProvider); |
29 }; | 32 }; |
30 | 33 |
| 34 // Base functionality for all policy providers that use a DictionaryValue tree |
| 35 // structure holding key-value pairs for storing policy settings. Decodes the |
| 36 // value tree and writes the configuration to the given |store|. |
| 37 void DecodePolicyValueTree(DictionaryValue* policies, |
| 38 ConfigurationPolicyStore* store); |
| 39 |
31 #endif // CHROME_BROWSER_CONFIGURATION_POLICY_PROVIDER_H_ | 40 #endif // CHROME_BROWSER_CONFIGURATION_POLICY_PROVIDER_H_ |
32 | |
OLD | NEW |