| Index: components/policy/core/common/config_dir_policy_loader.cc
|
| diff --git a/components/policy/core/common/config_dir_policy_loader.cc b/components/policy/core/common/config_dir_policy_loader.cc
|
| index c9344fd44754680e24162bbb1c1a566af2fd08c4..018a12ea7082dfbcfac9386f9e220b1b19887560 100644
|
| --- a/components/policy/core/common/config_dir_policy_loader.cc
|
| +++ b/components/policy/core/common/config_dir_policy_loader.cc
|
| @@ -22,6 +22,7 @@
|
| #include "components/policy/core/common/policy_bundle.h"
|
| #include "components/policy/core/common/policy_load_status.h"
|
| #include "components/policy/core/common/policy_types.h"
|
| +#include "policy/policy_constants.h"
|
|
|
| namespace policy {
|
|
|
| @@ -58,6 +59,20 @@ PolicyLoadStatus JsonErrorToPolicyLoadStatus(int status) {
|
| return POLICY_LOAD_STATUS_PARSE_ERROR;
|
| }
|
|
|
| +bool IsUserPolicy(const PolicyMap::const_iterator iter) {
|
| + const PolicyDetails* policy_details = GetChromePolicyDetails(iter->first);
|
| + if (!policy_details) {
|
| + LOG(ERROR) << "Ignoring unknown platform policy: " << iter->first;
|
| + return false;
|
| + }
|
| + if (policy_details->is_device_policy) {
|
| + // Device Policy is only implemented as Cloud Policy (not Platform Policy).
|
| + LOG(ERROR) << "Ignoring device platform policy: " << iter->first;
|
| + return false;
|
| + }
|
| + return true;
|
| +}
|
| +
|
| } // namespace
|
|
|
| ConfigDirPolicyLoader::ConfigDirPolicyLoader(
|
| @@ -171,6 +186,7 @@ void ConfigDirPolicyLoader::LoadFromPath(const base::FilePath& path,
|
| PolicyMap policy_map;
|
| policy_map.LoadFrom(dictionary_value, level, scope_,
|
| POLICY_SOURCE_PLATFORM);
|
| + policy_map.EraseNonmatching(base::Bind(&IsUserPolicy));
|
| bundle->Get(PolicyNamespace(POLICY_DOMAIN_CHROME, std::string()))
|
| .MergeFrom(policy_map);
|
| }
|
|
|