Chromium Code Reviews| Index: chromeos/network/managed_network_configuration_handler_impl.cc |
| diff --git a/chromeos/network/managed_network_configuration_handler_impl.cc b/chromeos/network/managed_network_configuration_handler_impl.cc |
| index b47f2dd9b216a89fc3876014d53771d93de0bbae..c02a714c2f7baf4cad1592fe3b782f128aec20f8 100644 |
| --- a/chromeos/network/managed_network_configuration_handler_impl.cc |
| +++ b/chromeos/network/managed_network_configuration_handler_impl.cc |
| @@ -30,6 +30,7 @@ |
| #include "chromeos/network/network_ui_data.h" |
| #include "chromeos/network/onc/onc_merger.h" |
| #include "chromeos/network/onc/onc_signature.h" |
| +#include "chromeos/network/onc/onc_translation_tables.h" |
| #include "chromeos/network/onc/onc_translator.h" |
| #include "chromeos/network/onc/onc_validator.h" |
| #include "chromeos/network/policy_util.h" |
| @@ -265,6 +266,12 @@ void ManagedNetworkConfigurationHandlerImpl::SetProperties( |
| return; |
| } |
| + // We need to ensure that required configuration properties (e.g. Type) are |
| + // included for ONC validation. |
| + scoped_ptr<base::DictionaryValue> user_settings_copy( |
| + network_util::TranslateNetworkConfigurationStateToONC(state)); |
|
pneubeck (no reviews)
2014/11/11 16:09:31
I think this is solution is not ideal yet.
We need
stevenjb
2014/11/12 01:23:29
Hmm. I don't like the idea of forcing the UI to sp
pneubeck (no reviews)
2014/11/13 17:38:56
Just looked at the validator, and I actually think
|
| + user_settings_copy->MergeDictionary(&user_settings); |
| + |
| // Validate the ONC dictionary. We are liberal and ignore unknown field |
| // names. User settings are only partial ONC, thus we ignore missing fields. |
| onc::Validator validator(false, // Ignore unknown fields. |
| @@ -276,7 +283,7 @@ void ManagedNetworkConfigurationHandlerImpl::SetProperties( |
| scoped_ptr<base::DictionaryValue> validated_user_settings = |
| validator.ValidateAndRepairObject( |
| &onc::kNetworkConfigurationSignature, |
| - user_settings, |
| + *user_settings_copy, |
| &validation_result); |
| if (validation_result == onc::Validator::INVALID) { |