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

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

Issue 1824743002: Drop non-user policy in ConfigDirPolicyLoader on Chrome OS. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 5 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/policy/core/common/config_dir_policy_loader.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_pref_store.cc
diff --git a/components/policy/core/browser/configuration_policy_pref_store.cc b/components/policy/core/browser/configuration_policy_pref_store.cc
index 90fee0d2c1ee3c764453873691623e755595307e..35afed7c77deb123ff944dd7cc15eeecef7118ad 100644
--- a/components/policy/core/browser/configuration_policy_pref_store.cc
+++ b/components/policy/core/browser/configuration_policy_pref_store.cc
@@ -33,6 +33,10 @@ void LogErrors(PolicyErrorMap* errors) {
}
}
+bool IsLevel(PolicyLevel level, const PolicyMap::const_iterator iter) {
+ return iter->second.level == level;
+}
+
} // namespace
ConfigurationPolicyPrefStore::ConfigurationPolicyPrefStore(
@@ -116,7 +120,7 @@ PrefValueMap* ConfigurationPolicyPrefStore::CreatePreferencesFromPolicies() {
PolicyMap filtered_policies;
filtered_policies.CopyFrom(policy_service_->GetPolicies(
PolicyNamespace(POLICY_DOMAIN_CHROME, std::string())));
- filtered_policies.FilterLevel(level_);
+ filtered_policies.EraseNonmatching(base::Bind(&IsLevel, level_));
std::unique_ptr<PolicyErrorMap> errors(new PolicyErrorMap);
« no previous file with comments | « no previous file | components/policy/core/common/config_dir_policy_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698