Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(40)

Side by Side Diff: chrome/browser/policy/configuration_policy_handler_list.cc

Issue 8480003: Surface error messages from ONC parsing in about:policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments, break out code gen / unit test changes. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 #include "chrome/browser/policy/configuration_policy_handler_list.h" 5 #include "chrome/browser/policy/configuration_policy_handler_list.h"
6 6
7 #include "base/stl_util.h" 7 #include "base/stl_util.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/policy/configuration_policy_handler.h" 9 #include "chrome/browser/policy/configuration_policy_handler.h"
10 #include "chrome/browser/policy/policy_error_map.h" 10 #include "chrome/browser/policy/policy_error_map.h"
11 #include "chrome/browser/policy/policy_map.h" 11 #include "chrome/browser/policy/policy_map.h"
12 #include "chrome/browser/prefs/pref_value_map.h" 12 #include "chrome/browser/prefs/pref_value_map.h"
13 #include "chrome/common/pref_names.h" 13 #include "chrome/common/pref_names.h"
14 #include "grit/generated_resources.h" 14 #include "grit/generated_resources.h"
15 #include "policy/policy_constants.h" 15 #include "policy/policy_constants.h"
16 16
17 #if defined(OS_CHROMEOS)
18 #include "chrome/browser/policy/configuration_policy_handler_chromeos.h"
19 #endif
20
17 namespace policy { 21 namespace policy {
18 22
19 namespace { 23 namespace {
20 24
21 // Maps a policy type to a preference path, and to the expected value type. 25 // Maps a policy type to a preference path, and to the expected value type.
22 // This is the entry type of |kSimplePolicyMap| below. 26 // This is the entry type of |kSimplePolicyMap| below.
23 struct PolicyToPreferenceMapEntry { 27 struct PolicyToPreferenceMapEntry {
24 base::Value::Type value_type; 28 base::Value::Type value_type;
25 ConfigurationPolicyType policy_type; 29 ConfigurationPolicyType policy_type;
26 const char* preference_path; 30 const char* preference_path;
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 handlers_.push_back(new DiskCacheDirPolicyHandler()); 208 handlers_.push_back(new DiskCacheDirPolicyHandler());
205 handlers_.push_back(new FileSelectionDialogsHandler()); 209 handlers_.push_back(new FileSelectionDialogsHandler());
206 handlers_.push_back(new IncognitoModePolicyHandler()); 210 handlers_.push_back(new IncognitoModePolicyHandler());
207 handlers_.push_back(new JavascriptPolicyHandler()); 211 handlers_.push_back(new JavascriptPolicyHandler());
208 handlers_.push_back(new ProxyPolicyHandler()); 212 handlers_.push_back(new ProxyPolicyHandler());
209 handlers_.push_back(new SyncPolicyHandler()); 213 handlers_.push_back(new SyncPolicyHandler());
210 214
211 #if !defined(OS_CHROMEOS) 215 #if !defined(OS_CHROMEOS)
212 handlers_.push_back(new DownloadDirPolicyHandler()); 216 handlers_.push_back(new DownloadDirPolicyHandler());
213 #endif // !defined(OS_CHROME0S) 217 #endif // !defined(OS_CHROME0S)
218
219 #if defined(OS_CHROMEOS)
220 handlers_.push_back(
221 new NetworkConfigurationPolicyHandler(
222 kPolicyDeviceOpenNetworkConfiguration));
223 handlers_.push_back(
224 new NetworkConfigurationPolicyHandler(
225 kPolicyOpenNetworkConfiguration));
226 #endif
214 } 227 }
215 228
216 ConfigurationPolicyHandlerList::~ConfigurationPolicyHandlerList() { 229 ConfigurationPolicyHandlerList::~ConfigurationPolicyHandlerList() {
217 STLDeleteElements(&handlers_); 230 STLDeleteElements(&handlers_);
218 } 231 }
219 232
220 void ConfigurationPolicyHandlerList::ApplyPolicySettings( 233 void ConfigurationPolicyHandlerList::ApplyPolicySettings(
221 const PolicyMap& policies, 234 const PolicyMap& policies,
222 PrefValueMap* prefs, 235 PrefValueMap* prefs,
223 PolicyErrorMap* errors) const { 236 PolicyErrorMap* errors) const {
(...skipping 16 matching lines...) Expand all
240 } 253 }
241 254
242 void ConfigurationPolicyHandlerList::PrepareForDisplaying( 255 void ConfigurationPolicyHandlerList::PrepareForDisplaying(
243 PolicyMap* policies) const { 256 PolicyMap* policies) const {
244 std::vector<ConfigurationPolicyHandler*>::const_iterator handler; 257 std::vector<ConfigurationPolicyHandler*>::const_iterator handler;
245 for (handler = handlers_.begin(); handler != handlers_.end(); ++handler) 258 for (handler = handlers_.begin(); handler != handlers_.end(); ++handler)
246 (*handler)->PrepareForDisplaying(policies); 259 (*handler)->PrepareForDisplaying(policies);
247 } 260 }
248 261
249 } // namespace policy 262 } // namespace policy
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698