Index: chrome/browser/policy/configuration_policy_handler_chromeos.cc |
diff --git a/chrome/browser/policy/configuration_policy_handler_chromeos.cc b/chrome/browser/policy/configuration_policy_handler_chromeos.cc |
index 4f72026934de99a877293b61a0a8d546edd6669f..189044912fbaf8afcf7a853067a1d14ae7554121 100644 |
--- a/chrome/browser/policy/configuration_policy_handler_chromeos.cc |
+++ b/chrome/browser/policy/configuration_policy_handler_chromeos.cc |
@@ -53,7 +53,7 @@ bool NetworkConfigurationPolicyHandler::CheckPolicySettings( |
scoped_ptr<base::DictionaryValue> root_dict = |
onc::ReadDictionaryFromJson(onc_blob, &json_error); |
if (root_dict.get() == NULL) { |
- errors->AddError(policy_name(), IDS_POLICY_NETWORK_CONFIG_PARSE_ERROR, |
+ errors->AddError(policy_name(), IDS_POLICY_NETWORK_CONFIG_PARSE_FAILED, |
json_error); |
return false; |
} |
@@ -66,16 +66,18 @@ bool NetworkConfigurationPolicyHandler::CheckPolicySettings( |
true); // Validate for managed ONC |
// ONC policies are always unencrypted. |
+ onc::Validator::Result validation_result; |
root_dict = validator.ValidateAndRepairObject( |
- &onc::kUnencryptedConfigurationSignature, |
- *root_dict); |
- |
- if (root_dict.get() == NULL) { |
- errors->AddError(policy_name(), IDS_POLICY_NETWORK_CONFIG_PARSE_ERROR); |
- // Don't reject the policy, as some networks or certificates could still |
- // be applied. |
- return true; |
+ &onc::kToplevelConfigurationSignature, *root_dict, &validation_result); |
+ if (validation_result == onc::Validator::VALID_WITH_WARNINGS) { |
+ errors->AddError(policy_name(), |
+ IDS_POLICY_NETWORK_CONFIG_VALID_WITH_WARNINGS); |
+ } else if (validation_result == onc::Validator::INVALID) { |
+ errors->AddError(policy_name(), IDS_POLICY_NETWORK_CONFIG_INVALID); |
} |
+ |
+ // In any case, don't reject the policy as some networks or certificates |
+ // could still be applied. |
} |
return true; |