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 c0407232335a56daf76c05767fa424c86380ee5c..a5921d0f231337f841df96d4ca62fcd3b8c60cf9 100644 |
| --- a/chromeos/network/managed_network_configuration_handler_impl.cc |
| +++ b/chromeos/network/managed_network_configuration_handler_impl.cc |
| @@ -34,6 +34,7 @@ |
| #include "chromeos/network/onc/onc_utils.h" |
| #include "chromeos/network/onc/onc_validator.h" |
| #include "chromeos/network/policy_util.h" |
| +#include "chromeos/network/prohibited_technologies_handler.h" |
| #include "chromeos/network/shill_property_util.h" |
| #include "components/onc/onc_constants.h" |
| #include "third_party/cros_system_api/dbus/service_constants.h" |
| @@ -426,6 +427,29 @@ void ManagedNetworkConfigurationHandlerImpl::SetPolicy( |
| policies->global_network_config.MergeDictionary(&global_network_config); |
| + // Update prohibited technologies. |
| + const base::ListValue* prohibited_list = nullptr; |
| + if (policies->global_network_config.GetListWithoutPathExpansion( |
| + ::onc::global_network_config::kDisableNetworkTypes, |
| + &prohibited_list) && |
| + prohibited_technologies_handler_) { |
| + // Prohobited technologies are only allowed in user policy. |
| + DCHECK_EQ(::onc::ONC_SOURCE_DEVICE_POLICY, onc_source); |
| + |
| + // Build up prohibited network type list and update NetworkStateHandler. |
|
stevenjb
2015/11/11 18:07:31
Comment out of date.
fqj
2015/11/12 10:23:01
Done.
|
| + std::vector<std::string> prohibited_technologies; |
| + for (const base::Value* item : *prohibited_list) { |
| + std::string prohibited_technology; |
| + item->GetAsString(&prohibited_technology); |
| + std::string translated_tech = |
| + network_util::TranslateONCTypeToShill(prohibited_technology); |
| + if (translated_tech.length()) |
|
stevenjb
2015/11/11 18:07:31
!translated_tech.empty()
fqj
2015/11/12 10:23:01
Done.
|
| + prohibited_technologies.push_back(translated_tech); |
| + } |
| + prohibited_technologies_handler_->SetProhibitedTechnologies( |
| + prohibited_technologies); |
|
stevenjb
2015/11/11 18:07:31
Since we have a separate handler now we should mov
fqj
2015/11/12 10:23:01
Done.
|
| + } |
| + |
| GuidToPolicyMap old_per_network_config; |
| policies->per_network_config.swap(old_per_network_config); |
| @@ -709,12 +733,14 @@ void ManagedNetworkConfigurationHandlerImpl::Init( |
| NetworkStateHandler* network_state_handler, |
| NetworkProfileHandler* network_profile_handler, |
| NetworkConfigurationHandler* network_configuration_handler, |
| - NetworkDeviceHandler* network_device_handler) { |
| + NetworkDeviceHandler* network_device_handler, |
| + ProhibitedTechnologiesHandler* prohibited_technologies_handler) { |
| network_state_handler_ = network_state_handler; |
| network_profile_handler_ = network_profile_handler; |
| network_configuration_handler_ = network_configuration_handler; |
| network_device_handler_ = network_device_handler; |
| network_profile_handler_->AddObserver(this); |
| + prohibited_technologies_handler_ = prohibited_technologies_handler; |
| } |
| void ManagedNetworkConfigurationHandlerImpl::OnPolicyAppliedToNetwork( |