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

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

Issue 8480003: Surface error messages from ONC parsing in about:policy. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebased version with password stripping. 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
« no previous file with comments | « chrome/browser/policy/configuration_policy_handler_list.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_reader.h" 5 #include "chrome/browser/policy/configuration_policy_reader.h"
6 6
7 #include <map> 7 #include <map>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 void ConfigurationPolicyStatusKeeper::GetPoliciesFromProvider( 72 void ConfigurationPolicyStatusKeeper::GetPoliciesFromProvider(
73 ConfigurationPolicyProvider* provider) { 73 ConfigurationPolicyProvider* provider) {
74 PolicyMap policies; 74 PolicyMap policies;
75 if (!provider->Provide(&policies)) 75 if (!provider->Provide(&policies))
76 DLOG(WARNING) << "Failed to get policy from provider."; 76 DLOG(WARNING) << "Failed to get policy from provider.";
77 77
78 PolicyErrorMap errors; 78 PolicyErrorMap errors;
79 const ConfigurationPolicyHandlerList* handler_list = 79 const ConfigurationPolicyHandlerList* handler_list =
80 g_browser_process->browser_policy_connector()->GetHandlerList(); 80 g_browser_process->browser_policy_connector()->GetHandlerList();
81 handler_list->ApplyPolicySettings(policies, NULL, &errors); 81 handler_list->ApplyPolicySettings(policies, NULL, &errors);
82 handler_list->PrepareForDisplaying(&policies);
Joao da Silva 2011/11/11 16:20:54 How was this missing :-)
82 83
83 PolicyMap::const_iterator policy = policies.begin(); 84 PolicyMap::const_iterator policy = policies.begin();
84 for ( ; policy != policies.end(); ++policy) { 85 for ( ; policy != policies.end(); ++policy) {
85 string16 name = ASCIIToUTF16(GetPolicyName(policy->first)); 86 string16 name = ASCIIToUTF16(GetPolicyName(policy->first));
86 string16 error_message = errors.GetErrors(policy->first); 87 string16 error_message = errors.GetErrors(policy->first);
87 PolicyStatusInfo::PolicyStatus status = 88 PolicyStatusInfo::PolicyStatus status =
88 error_message.empty() ? PolicyStatusInfo::ENFORCED 89 error_message.empty() ? PolicyStatusInfo::ENFORCED
89 : PolicyStatusInfo::FAILED; 90 : PolicyStatusInfo::FAILED;
90 // TODO(joaodasilva): determine whether this is a user or device policy. 91 // TODO(joaodasilva): determine whether this is a user or device policy.
91 // http://crbug.com/102114 92 // http://crbug.com/102114
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 list->Append(mc_policy); 270 list->Append(mc_policy);
270 if (rp_policy) 271 if (rp_policy)
271 list->Append(rp_policy); 272 list->Append(rp_policy);
272 if (rc_policy) 273 if (rc_policy)
273 list->Append(rc_policy); 274 list->Append(rc_policy);
274 275
275 return added_policy; 276 return added_policy;
276 } 277 }
277 278
278 } // namespace policy 279 } // namespace policy
OLDNEW
« no previous file with comments | « chrome/browser/policy/configuration_policy_handler_list.cc ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698