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

Unified Diff: components/search_engines/default_search_policy_handler.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 | « components/policy/core/browser/configuration_policy_handler_list.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/search_engines/default_search_policy_handler.cc
diff --git a/components/search_engines/default_search_policy_handler.cc b/components/search_engines/default_search_policy_handler.cc
index a2837ee8a1232e0a9a5df5dc1e99bd1ce4574e14..7c742da59031f4b2c2becd2d36e37c2c994781b9 100644
--- a/components/search_engines/default_search_policy_handler.cc
+++ b/components/search_engines/default_search_policy_handler.cc
@@ -301,11 +301,13 @@ void DefaultSearchPolicyHandler::ApplyPolicySettings(const PolicyMap& policies,
bool DefaultSearchPolicyHandler::CheckIndividualPolicies(
const PolicyMap& policies,
PolicyErrorMap* errors) {
+ bool all_ok = true;
for (const auto& handler : handlers_) {
- if (!handler->CheckPolicySettings(policies, errors))
- return false;
+ // It's important to call CheckPolicySettings() on all handlers and not just
+ // exit on the first error, so we report all policy errors.
+ all_ok &= handler->CheckPolicySettings(policies, errors);
}
- return true;
+ return all_ok;
}
bool DefaultSearchPolicyHandler::HasDefaultSearchPolicy(
« no previous file with comments | « components/policy/core/browser/configuration_policy_handler_list.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698