Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(83)

Unified Diff: chromeos/network/managed_network_configuration_handler_impl.cc

Issue 694533007: Add 'setProperties' to InternetOptionsHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 ebe5d542193f61795141c4711827b82b7c960a4e..3158f0968e58447b353258a246bc3ee802a50274 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));
+ 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) {

Powered by Google App Engine
This is Rietveld 408576698