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