OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CONFIGURATION_POLICY_PROVIDER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_H_ |
6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_H_ | 6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 | 96 |
97 // Manages observers for a ConfigurationPolicyProvider. Is used to register | 97 // Manages observers for a ConfigurationPolicyProvider. Is used to register |
98 // observers, and automatically removes them upon destruction. | 98 // observers, and automatically removes them upon destruction. |
99 // Implementation detail: to avoid duplicate bookkeeping of registered | 99 // Implementation detail: to avoid duplicate bookkeeping of registered |
100 // observers, this registrar class acts as a proxy for notifications (since it | 100 // observers, this registrar class acts as a proxy for notifications (since it |
101 // needs to register itself anyway to get OnProviderGoingAway notifications). | 101 // needs to register itself anyway to get OnProviderGoingAway notifications). |
102 class ConfigurationPolicyObserverRegistrar | 102 class ConfigurationPolicyObserverRegistrar |
103 : ConfigurationPolicyProvider::Observer { | 103 : ConfigurationPolicyProvider::Observer { |
104 public: | 104 public: |
105 ConfigurationPolicyObserverRegistrar(); | 105 ConfigurationPolicyObserverRegistrar(); |
106 ~ConfigurationPolicyObserverRegistrar(); | 106 virtual ~ConfigurationPolicyObserverRegistrar(); |
107 void Init(ConfigurationPolicyProvider* provider, | 107 void Init(ConfigurationPolicyProvider* provider, |
108 ConfigurationPolicyProvider::Observer* observer); | 108 ConfigurationPolicyProvider::Observer* observer); |
109 | 109 |
110 // ConfigurationPolicyProvider::Observer implementation: | 110 // ConfigurationPolicyProvider::Observer implementation: |
111 virtual void OnUpdatePolicy(); | 111 virtual void OnUpdatePolicy(); |
112 virtual void OnProviderGoingAway(); | 112 virtual void OnProviderGoingAway(); |
113 | 113 |
114 private: | 114 private: |
115 ConfigurationPolicyProvider* provider_; | 115 ConfigurationPolicyProvider* provider_; |
116 ConfigurationPolicyProvider::Observer* observer_; | 116 ConfigurationPolicyProvider::Observer* observer_; |
117 | 117 |
118 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyObserverRegistrar); | 118 DISALLOW_COPY_AND_ASSIGN(ConfigurationPolicyObserverRegistrar); |
119 }; | 119 }; |
120 | 120 |
121 } // namespace policy | 121 } // namespace policy |
122 | 122 |
123 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_H_ | 123 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_PROVIDER_H_ |
OLD | NEW |