Chromium Code Reviews| Index: components/policy/core/common/policy_service_impl.cc |
| diff --git a/components/policy/core/common/policy_service_impl.cc b/components/policy/core/common/policy_service_impl.cc |
| index 96922ace797cebb1970bbf359acaa8f729bb74c1..2cde1a5957bce5a6e745b47d4f1b2cc2c1df6e1d 100644 |
| --- a/components/policy/core/common/policy_service_impl.cc |
| +++ b/components/policy/core/common/policy_service_impl.cc |
| @@ -14,6 +14,7 @@ |
| #include "base/values.h" |
| #include "components/policy/core/common/policy_bundle.h" |
| #include "components/policy/core/common/policy_map.h" |
| +#include "components/policy/core/common/policy_types.h" |
| #include "policy/policy_constants.h" |
| namespace policy { |
| @@ -41,6 +42,7 @@ void FixDeprecatedPolicies(PolicyMap* policies) { |
| // The highest (level, scope) pair for an existing proxy policy is determined |
| // first, and then only policies with those exact attributes are merged. |
| PolicyMap::Entry current_priority; // Defaults to the lowest priority. |
| + PolicySource inherited_source = POLICY_SOURCE_PLATFORM; |
| scoped_ptr<base::DictionaryValue> proxy_settings(new base::DictionaryValue); |
| for (size_t i = 0; i < arraysize(kProxyPolicies); ++i) { |
| const PolicyMap::Entry* entry = policies->Get(kProxyPolicies[i]); |
| @@ -48,6 +50,7 @@ void FixDeprecatedPolicies(PolicyMap* policies) { |
| if (entry->has_higher_priority_than(current_priority)) { |
| proxy_settings->Clear(); |
| current_priority = *entry; |
| + inherited_source = entry->source; // Source of last existing entry. |
|
bartfab (slow)
2015/09/17 15:45:51
Nit: Policy sources actually have a precedence ord
fhorschig
2015/09/18 08:30:22
Agreed. Platform policies can override (all known)
|
| } |
| if (!entry->has_higher_priority_than(current_priority) && |
| !current_priority.has_higher_priority_than(*entry)) { |
| @@ -64,6 +67,7 @@ void FixDeprecatedPolicies(PolicyMap* policies) { |
| policies->Set(key::kProxySettings, |
| current_priority.level, |
| current_priority.scope, |
| + inherited_source, |
| proxy_settings.release(), |
| NULL); |
| } |