| 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_POLICY_POLICY_SERVICE_H_ | 5 #ifndef CHROME_BROWSER_POLICY_POLICY_SERVICE_H_ |
| 6 #define CHROME_BROWSER_POLICY_POLICY_SERVICE_H_ | 6 #define CHROME_BROWSER_POLICY_POLICY_SERVICE_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // IsInitializationComplete() is false, then this will be invoked once all | 50 // IsInitializationComplete() is false, then this will be invoked once all |
| 51 // the policy providers are ready. | 51 // the policy providers are ready. |
| 52 virtual void OnPolicyServiceInitialized() {} | 52 virtual void OnPolicyServiceInitialized() {} |
| 53 | 53 |
| 54 protected: | 54 protected: |
| 55 virtual ~Observer() {} | 55 virtual ~Observer() {} |
| 56 }; | 56 }; |
| 57 | 57 |
| 58 virtual ~PolicyService() {} | 58 virtual ~PolicyService() {} |
| 59 | 59 |
| 60 virtual void AddObserver(PolicyDomain domain, | 60 // Observes changes to all components of the given |domain|. |
| 61 const std::string& component_id, | 61 virtual void AddObserver(PolicyDomain domain, Observer* observer) = 0; |
| 62 Observer* observer) = 0; | |
| 63 | 62 |
| 64 virtual void RemoveObserver(PolicyDomain domain, | 63 virtual void RemoveObserver(PolicyDomain domain, Observer* observer) = 0; |
| 65 const std::string& component_id, | |
| 66 Observer* observer) = 0; | |
| 67 | 64 |
| 68 virtual const PolicyMap& GetPolicies( | 65 virtual const PolicyMap& GetPolicies( |
| 69 PolicyDomain domain, | 66 PolicyDomain domain, |
| 70 const std::string& component_id) const = 0; | 67 const std::string& component_id) const = 0; |
| 71 | 68 |
| 72 // The PolicyService loads policy from several sources, and some require | 69 // The PolicyService loads policy from several sources, and some require |
| 73 // asynchronous loads. IsInitializationComplete() returns true once all | 70 // asynchronous loads. IsInitializationComplete() returns true once all |
| 74 // sources have loaded their policies. It is safe to read policy from the | 71 // sources have loaded their policies. It is safe to read policy from the |
| 75 // PolicyService even if IsInitializationComplete() is false; there will be an | 72 // PolicyService even if IsInitializationComplete() is false; there will be an |
| 76 // OnPolicyUpdated() notification once new policies become available. | 73 // OnPolicyUpdated() notification once new policies become available. |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 PolicyDomain domain_; | 119 PolicyDomain domain_; |
| 123 std::string component_id_; | 120 std::string component_id_; |
| 124 CallbackMap callback_map_; | 121 CallbackMap callback_map_; |
| 125 | 122 |
| 126 DISALLOW_COPY_AND_ASSIGN(PolicyChangeRegistrar); | 123 DISALLOW_COPY_AND_ASSIGN(PolicyChangeRegistrar); |
| 127 }; | 124 }; |
| 128 | 125 |
| 129 } // namespace policy | 126 } // namespace policy |
| 130 | 127 |
| 131 #endif // CHROME_BROWSER_POLICY_POLICY_SERVICE_H_ | 128 #endif // CHROME_BROWSER_POLICY_POLICY_SERVICE_H_ |
| OLD | NEW |