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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 virtual ~PolicyService() {} | 56 virtual ~PolicyService() {} |
57 | 57 |
58 virtual void AddObserver(PolicyDomain domain, | 58 virtual void AddObserver(PolicyDomain domain, |
59 const std::string& component_id, | 59 const std::string& component_id, |
60 Observer* observer) = 0; | 60 Observer* observer) = 0; |
61 | 61 |
62 virtual void RemoveObserver(PolicyDomain domain, | 62 virtual void RemoveObserver(PolicyDomain domain, |
63 const std::string& component_id, | 63 const std::string& component_id, |
64 Observer* observer) = 0; | 64 Observer* observer) = 0; |
65 | 65 |
66 // Returns NULL if no policies are available for |domain|, | component_id|. | 66 virtual const PolicyMap& GetPolicies( |
67 virtual const PolicyMap* GetPolicies( | |
68 PolicyDomain domain, | 67 PolicyDomain domain, |
69 const std::string& component_id) const = 0; | 68 const std::string& component_id) const = 0; |
70 | 69 |
71 // The PolicyService loads policy from several sources, and some require | 70 // The PolicyService loads policy from several sources, and some require |
72 // asynchronous loads. IsInitializationComplete() returns true once all | 71 // asynchronous loads. IsInitializationComplete() returns true once all |
73 // sources have loaded their policies. It is safe to read policy from the | 72 // sources have loaded their policies. It is safe to read policy from the |
74 // PolicyService even if IsInitializationComplete() is false; there will be an | 73 // PolicyService even if IsInitializationComplete() is false; there will be an |
75 // OnPolicyUpdated() notification once new policies become available. | 74 // OnPolicyUpdated() notification once new policies become available. |
76 // | 75 // |
77 // OnPolicyServiceInitialized() is called when IsInitializationComplete() | 76 // OnPolicyServiceInitialized() is called when IsInitializationComplete() |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 PolicyDomain domain_; | 120 PolicyDomain domain_; |
122 std::string component_id_; | 121 std::string component_id_; |
123 CallbackMap callback_map_; | 122 CallbackMap callback_map_; |
124 | 123 |
125 DISALLOW_COPY_AND_ASSIGN(PolicyChangeRegistrar); | 124 DISALLOW_COPY_AND_ASSIGN(PolicyChangeRegistrar); |
126 }; | 125 }; |
127 | 126 |
128 } // namespace policy | 127 } // namespace policy |
129 | 128 |
130 #endif // CHROME_BROWSER_POLICY_POLICY_SERVICE_H_ | 129 #endif // CHROME_BROWSER_POLICY_POLICY_SERVICE_H_ |
OLD | NEW |