| 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_IMPL_H_ | 5 #ifndef COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_ |
| 6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_ | 6 #define COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_ |
| 7 | 7 |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 30 matching lines...) Expand all Loading... |
| 41 // PolicyService overrides: | 41 // PolicyService overrides: |
| 42 void AddObserver(PolicyDomain domain, | 42 void AddObserver(PolicyDomain domain, |
| 43 PolicyService::Observer* observer) override; | 43 PolicyService::Observer* observer) override; |
| 44 void RemoveObserver(PolicyDomain domain, | 44 void RemoveObserver(PolicyDomain domain, |
| 45 PolicyService::Observer* observer) override; | 45 PolicyService::Observer* observer) override; |
| 46 const PolicyMap& GetPolicies(const PolicyNamespace& ns) const override; | 46 const PolicyMap& GetPolicies(const PolicyNamespace& ns) const override; |
| 47 bool IsInitializationComplete(PolicyDomain domain) const override; | 47 bool IsInitializationComplete(PolicyDomain domain) const override; |
| 48 void RefreshPolicies(const base::Closure& callback) override; | 48 void RefreshPolicies(const base::Closure& callback) override; |
| 49 | 49 |
| 50 private: | 50 private: |
| 51 typedef ObserverList<PolicyService::Observer, true> Observers; | 51 typedef base::ObserverList<PolicyService::Observer, true> Observers; |
| 52 typedef std::map<PolicyDomain, Observers*> ObserverMap; | 52 typedef std::map<PolicyDomain, Observers*> ObserverMap; |
| 53 | 53 |
| 54 // ConfigurationPolicyProvider::Observer overrides: | 54 // ConfigurationPolicyProvider::Observer overrides: |
| 55 void OnUpdatePolicy(ConfigurationPolicyProvider* provider) override; | 55 void OnUpdatePolicy(ConfigurationPolicyProvider* provider) override; |
| 56 | 56 |
| 57 // Posts a task to notify observers of |ns| that its policies have changed, | 57 // Posts a task to notify observers of |ns| that its policies have changed, |
| 58 // passing along the |previous| and the |current| policies. | 58 // passing along the |previous| and the |current| policies. |
| 59 void NotifyNamespaceUpdated(const PolicyNamespace& ns, | 59 void NotifyNamespaceUpdated(const PolicyNamespace& ns, |
| 60 const PolicyMap& previous, | 60 const PolicyMap& previous, |
| 61 const PolicyMap& current); | 61 const PolicyMap& current); |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 // Used to create tasks to delay new policy updates while we may be already | 97 // Used to create tasks to delay new policy updates while we may be already |
| 98 // processing previous policy updates. | 98 // processing previous policy updates. |
| 99 base::WeakPtrFactory<PolicyServiceImpl> update_task_ptr_factory_; | 99 base::WeakPtrFactory<PolicyServiceImpl> update_task_ptr_factory_; |
| 100 | 100 |
| 101 DISALLOW_COPY_AND_ASSIGN(PolicyServiceImpl); | 101 DISALLOW_COPY_AND_ASSIGN(PolicyServiceImpl); |
| 102 }; | 102 }; |
| 103 | 103 |
| 104 } // namespace policy | 104 } // namespace policy |
| 105 | 105 |
| 106 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_ | 106 #endif // COMPONENTS_POLICY_CORE_COMMON_POLICY_SERVICE_IMPL_H_ |
| OLD | NEW |