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_READER_H_ | 5 #ifndef CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_READER_H_ |
6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_READER_H_ | 6 #define CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_READER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
109 | 109 |
110 // Removes an observer from each one of the ConfigurationPolicyReaders. | 110 // Removes an observer from each one of the ConfigurationPolicyReaders. |
111 void RemoveObserver(Observer* observer) const; | 111 void RemoveObserver(Observer* observer) const; |
112 | 112 |
113 // Returns a ListValue pointer containing the status information of all | 113 // Returns a ListValue pointer containing the status information of all |
114 // policies supported by the client. |any_policies_set| is set to true if | 114 // policies supported by the client. |any_policies_set| is set to true if |
115 // there are policies in the list that were sent by a provider, otherwise | 115 // there are policies in the list that were sent by a provider, otherwise |
116 // it is set to false. This is for the about:policy UI to display. | 116 // it is set to false. This is for the about:policy UI to display. |
117 ListValue* GetPolicyStatusList(bool* any_policies_set) const; | 117 ListValue* GetPolicyStatusList(bool* any_policies_set) const; |
118 | 118 |
119 // Returns a string16 containing the actual name of the policy corresponding | |
120 // to |policy_type|. Returns an empty string if there is no such policy_type | |
121 // among the policies supported by the client. | |
122 static string16 GetPolicyName(ConfigurationPolicyType policy_type); | |
123 | |
124 private: | 119 private: |
125 typedef ConfigurationPolicyProvider::PolicyDefinitionList | |
126 PolicyDefinitionList; | |
127 | |
128 // Add the policy information for |policy| to the ListValue pointed to be | 120 // Add the policy information for |policy| to the ListValue pointed to be |
129 // |list| as it is returned by the different ConfigurationPolicyReader | 121 // |list| as it is returned by the different ConfigurationPolicyReader |
130 // objects. Returns true if a policy was added and false otherwise. | 122 // objects. Returns true if a policy was added and false otherwise. |
131 bool AddPolicyFromReaders(ConfigurationPolicyType policy, | 123 bool AddPolicyFromReaders(ConfigurationPolicyType policy, |
132 ListValue* list) const; | 124 ListValue* list) const; |
133 | 125 |
134 scoped_ptr<ConfigurationPolicyReader> managed_platform_; | 126 scoped_ptr<ConfigurationPolicyReader> managed_platform_; |
135 scoped_ptr<ConfigurationPolicyReader> managed_cloud_; | 127 scoped_ptr<ConfigurationPolicyReader> managed_cloud_; |
136 scoped_ptr<ConfigurationPolicyReader> recommended_platform_; | 128 scoped_ptr<ConfigurationPolicyReader> recommended_platform_; |
137 scoped_ptr<ConfigurationPolicyReader> recommended_cloud_; | 129 scoped_ptr<ConfigurationPolicyReader> recommended_cloud_; |
138 | 130 |
139 DISALLOW_COPY_AND_ASSIGN(PolicyStatus); | 131 DISALLOW_COPY_AND_ASSIGN(PolicyStatus); |
140 }; | 132 }; |
141 | 133 |
142 } // namespace policy | 134 } // namespace policy |
143 | 135 |
144 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_READER_H_ | 136 #endif // CHROME_BROWSER_POLICY_CONFIGURATION_POLICY_READER_H_ |
OLD | NEW |