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 #include "components/policy/core/common/config_dir_policy_loader.h" | 5 #include "components/policy/core/common/config_dir_policy_loader.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <set> | 10 #include <set> |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
205 LOG(WARNING) << "3rdparty value is not a dictionary!"; | 205 LOG(WARNING) << "3rdparty value is not a dictionary!"; |
206 return; | 206 return; |
207 } | 207 } |
208 | 208 |
209 // Helper to lookup a domain given its string name. | 209 // Helper to lookup a domain given its string name. |
210 std::map<std::string, PolicyDomain> supported_domains; | 210 std::map<std::string, PolicyDomain> supported_domains; |
211 supported_domains["extensions"] = POLICY_DOMAIN_EXTENSIONS; | 211 supported_domains["extensions"] = POLICY_DOMAIN_EXTENSIONS; |
212 | 212 |
213 for (base::DictionaryValue::Iterator domains_it(*domains_dictionary); | 213 for (base::DictionaryValue::Iterator domains_it(*domains_dictionary); |
214 !domains_it.IsAtEnd(); domains_it.Advance()) { | 214 !domains_it.IsAtEnd(); domains_it.Advance()) { |
215 if (!ContainsKey(supported_domains, domains_it.key())) { | 215 if (!base::ContainsKey(supported_domains, domains_it.key())) { |
216 LOG(WARNING) << "Unsupported 3rd party policy domain: " | 216 LOG(WARNING) << "Unsupported 3rd party policy domain: " |
217 << domains_it.key(); | 217 << domains_it.key(); |
218 continue; | 218 continue; |
219 } | 219 } |
220 | 220 |
221 const base::DictionaryValue* components_dictionary; | 221 const base::DictionaryValue* components_dictionary; |
222 if (!domains_it.value().GetAsDictionary(&components_dictionary)) { | 222 if (!domains_it.value().GetAsDictionary(&components_dictionary)) { |
223 LOG(WARNING) << "3rdparty/" << domains_it.key() | 223 LOG(WARNING) << "3rdparty/" << domains_it.key() |
224 << " value is not a dictionary!"; | 224 << " value is not a dictionary!"; |
225 continue; | 225 continue; |
(...skipping 17 matching lines...) Expand all Loading... |
243 } | 243 } |
244 } | 244 } |
245 | 245 |
246 void ConfigDirPolicyLoader::OnFileUpdated(const base::FilePath& path, | 246 void ConfigDirPolicyLoader::OnFileUpdated(const base::FilePath& path, |
247 bool error) { | 247 bool error) { |
248 if (!error) | 248 if (!error) |
249 Reload(false); | 249 Reload(false); |
250 } | 250 } |
251 | 251 |
252 } // namespace policy | 252 } // namespace policy |
OLD | NEW |