| 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 // Must be implemented by provider subclasses to specify the | 24 // Must be implemented by provider subclasses to specify the |
| 25 // provider-specific policy decisions. The preference service | 25 // provider-specific policy decisions. The preference service |
| 26 // invokes this |Provide| method when it needs a policy | 26 // invokes this |Provide| method when it needs a policy |
| 27 // provider to specify its policy choices. In |Provide|, | 27 // provider to specify its policy choices. In |Provide|, |
| 28 // the |ConfigurationPolicyProvider| must make calls to the | 28 // the |ConfigurationPolicyProvider| must make calls to the |
| 29 // |Apply| method of |store| to apply specific policies. | 29 // |Apply| method of |store| to apply specific policies. |
| 30 // Returns true if the policy could be provided, otherwise false. | 30 // Returns true if the policy could be provided, otherwise false. |
| 31 virtual bool Provide(ConfigurationPolicyStore* store) = 0; | 31 virtual bool Provide(ConfigurationPolicyStore* store) = 0; |
| 32 | 32 |
| 33 // Called by the subclass provider at any time to indicate that the currently |
| 34 // applied policy is not longer current. A policy refresh will be initiated as |
| 35 // soon as possible. |
| 36 virtual void NotifyStoreOfPolicyChange(); |
| 37 |
| 33 protected: | 38 protected: |
| 34 // A structure mapping policies to their implementations by providers. | 39 // A structure mapping policies to their implementations by providers. |
| 35 struct PolicyValueMapEntry { | 40 struct PolicyValueMapEntry { |
| 36 ConfigurationPolicyStore::PolicyType policy_type; | 41 ConfigurationPolicyStore::PolicyType policy_type; |
| 37 Value::ValueType value_type; | 42 Value::ValueType value_type; |
| 38 std::string name; | 43 std::string name; |
| 39 }; | 44 }; |
| 40 typedef std::vector<PolicyValueMapEntry> PolicyValueMap; | 45 typedef std::vector<PolicyValueMapEntry> PolicyValueMap; |
| 41 | 46 |
| 42 // Returns the mapping from policy values to the actual names used by | 47 // Returns the mapping from policy values to the actual names used by |
| 43 // implementations. | 48 // implementations. |
| 44 static const PolicyValueMap* PolicyValueMapping(); | 49 static const PolicyValueMap* PolicyValueMapping(); |
| 45 | 50 |
| 46 private: | 51 private: |
| 47 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyProvider); | 52 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyProvider); |
| 48 }; | 53 }; |
| 49 | 54 |
| 50 #endif // CHROME_BROWSER_CONFIGURATION_POLICY_PROVIDER_H_ | 55 #endif // CHROME_BROWSER_CONFIGURATION_POLICY_PROVIDER_H_ |
| 51 | 56 |
| OLD | NEW |