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

Unified Diff: components/policy/core/browser/configuration_policy_handler_list.cc

Issue 2400703002: Fix policy checks for chrome://policy (Closed)
Patch Set: Fix nits in default_search_policy_handler.cc Created 4 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/search_engines/default_search_policy_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/policy/core/browser/configuration_policy_handler_list.cc
diff --git a/components/policy/core/browser/configuration_policy_handler_list.cc b/components/policy/core/browser/configuration_policy_handler_list.cc
index 8fb0ed51bce92bd4f6ce066930113724cbbec875..9cdfc2aa897fbef1cd53f97489786ad6347eed67 100644
--- a/components/policy/core/browser/configuration_policy_handler_list.cc
+++ b/components/policy/core/browser/configuration_policy_handler_list.cc
@@ -32,6 +32,10 @@ void ConfigurationPolicyHandlerList::ApplyPolicySettings(
const PolicyMap& policies,
PrefValueMap* prefs,
PolicyErrorMap* errors) const {
+ // This function is used both to apply the policy settings, and to check them
+ // and list errors. As such it must get all the errors even if it isn't
+ // applying the policies.
+ // TODO (aberent) split into two functions.
PolicyErrorMap scoped_errors;
if (!errors)
errors = &scoped_errors;
@@ -39,13 +43,11 @@ void ConfigurationPolicyHandlerList::ApplyPolicySettings(
policy::PolicyHandlerParameters parameters;
parameters_callback_.Run(&parameters);
- if (prefs) {
- std::vector<ConfigurationPolicyHandler*>::const_iterator handler;
- for (handler = handlers_.begin(); handler != handlers_.end(); ++handler) {
- if ((*handler)->CheckPolicySettings(policies, errors)) {
- (*handler)
- ->ApplyPolicySettingsWithParameters(policies, parameters, prefs);
- }
+ std::vector<ConfigurationPolicyHandler*>::const_iterator handler;
+ for (handler = handlers_.begin(); handler != handlers_.end(); ++handler) {
+ if ((*handler)->CheckPolicySettings(policies, errors) && prefs) {
+ (*handler)
+ ->ApplyPolicySettingsWithParameters(policies, parameters, prefs);
}
}
« no previous file with comments | « no previous file | components/search_engines/default_search_policy_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698