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); |