| 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 COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_H_ |
| 6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // |previous| contains the values of the policies before the update, | 32 // |previous| contains the values of the policies before the update, |
| 33 // and |current| contains the current values. | 33 // and |current| contains the current values. |
| 34 virtual void OnPolicyUpdated(const PolicyNamespace& ns, | 34 virtual void OnPolicyUpdated(const PolicyNamespace& ns, |
| 35 const PolicyMap& previous, | 35 const PolicyMap& previous, |
| 36 const PolicyMap& current) = 0; | 36 const PolicyMap& current) = 0; |
| 37 | 37 |
| 38 // Invoked at most once for each |domain|, when the PolicyService becomes | 38 // Invoked at most once for each |domain|, when the PolicyService becomes |
| 39 // ready. If IsInitializationComplete() is false, then this will be invoked | 39 // ready. If IsInitializationComplete() is false, then this will be invoked |
| 40 // once all the policy providers have finished loading their policies for | 40 // once all the policy providers have finished loading their policies for |
| 41 // |domain|. | 41 // |domain|. |
| 42 virtual void OnPolicyServiceInitialized(PolicyDomain domain) {} | 42 virtual void OnPolicyServiceInitialized(PolicyDomain domain); |
| 43 |
| 44 #if defined(WIN32) && defined(COMPONENT_BUILD) |
| 45 Observer(); |
| 46 #endif |
| 43 | 47 |
| 44 protected: | 48 protected: |
| 45 virtual ~Observer() {} | 49 virtual ~Observer(); |
| 46 }; | 50 }; |
| 47 | 51 |
| 48 virtual ~PolicyService() {} | 52 virtual ~PolicyService(); |
| 49 | 53 |
| 50 // Observes changes to all components of the given |domain|. | 54 // Observes changes to all components of the given |domain|. |
| 51 virtual void AddObserver(PolicyDomain domain, Observer* observer) = 0; | 55 virtual void AddObserver(PolicyDomain domain, Observer* observer) = 0; |
| 52 | 56 |
| 53 virtual void RemoveObserver(PolicyDomain domain, Observer* observer) = 0; | 57 virtual void RemoveObserver(PolicyDomain domain, Observer* observer) = 0; |
| 54 | 58 |
| 55 virtual const PolicyMap& GetPolicies(const PolicyNamespace& ns) const = 0; | 59 virtual const PolicyMap& GetPolicies(const PolicyNamespace& ns) const = 0; |
| 56 | 60 |
| 57 // The PolicyService loads policy from several sources, and some require | 61 // The PolicyService loads policy from several sources, and some require |
| 58 // asynchronous loads. IsInitializationComplete() returns true once all | 62 // asynchronous loads. IsInitializationComplete() returns true once all |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 PolicyService* policy_service_; | 111 PolicyService* policy_service_; |
| 108 PolicyNamespace ns_; | 112 PolicyNamespace ns_; |
| 109 CallbackMap callback_map_; | 113 CallbackMap callback_map_; |
| 110 | 114 |
| 111 DISALLOW_COPY_AND_ASSIGN(PolicyChangeRegistrar); | 115 DISALLOW_COPY_AND_ASSIGN(PolicyChangeRegistrar); |
| 112 }; | 116 }; |
| 113 | 117 |
| 114 } // namespace policy | 118 } // namespace policy |
| 115 | 119 |
| 116 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_H_ | 120 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_H_ |
| OLD | NEW |