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 8ada86f35ce871ea9c857f0f00718c159f95b5b4..427d323473cc17efb4cc852083930ca151d8d899 100644 |
| --- a/chromeos/network/managed_network_configuration_handler_impl.cc |
| +++ b/chromeos/network/managed_network_configuration_handler_impl.cc |
| @@ -38,6 +38,7 @@ |
| #include "chromeos/network/policy_util.h" |
| #include "chromeos/network/prohibited_technologies_handler.h" |
| #include "chromeos/network/shill_property_util.h" |
| +#include "chromeos/network/tether_constants.h" |
| #include "components/onc/onc_constants.h" |
| #include "third_party/cros_system_api/dbus/service_constants.h" |
| @@ -143,8 +144,12 @@ void ManagedNetworkConfigurationHandlerImpl::SendManagedProperties( |
| &profile_path); |
| const NetworkProfile* profile = |
| network_profile_handler_->GetProfileForPath(profile_path); |
| - if (!profile) |
| + if (!profile && !onc::IsTetherShillDictionary(*shill_properties)) { |
| + // Tether networks are not expected to have an associated profile; only |
| + // log an error if the provided properties do not correspond to a |
| + // Tether network. |
| NET_LOG_ERROR("No profile for service: " + profile_path, service_path); |
| + } |
| std::unique_ptr<NetworkUIData> ui_data = |
| shill_property_util::GetUIDataFromProperties(*shill_properties); |
| @@ -172,8 +177,6 @@ void ManagedNetworkConfigurationHandlerImpl::SendManagedProperties( |
| &onc::kNetworkWithStateSignature, |
| network_state)); |
| - const base::DictionaryValue* network_policy = NULL; |
| - const base::DictionaryValue* global_policy = NULL; |
| if (profile) { |
| const Policies* policies = GetPoliciesForProfile(*profile); |
| if (!policies) { |
| @@ -181,16 +184,20 @@ void ManagedNetworkConfigurationHandlerImpl::SendManagedProperties( |
| service_path, error_callback, kPoliciesNotInitialized); |
| return; |
| } |
| - if (!guid.empty()) |
| - network_policy = GetByGUID(policies->per_network_config, guid); |
| - global_policy = &policies->global_network_config; |
| - } |
| - std::unique_ptr<base::DictionaryValue> augmented_properties( |
| - policy_util::CreateManagedONC(global_policy, network_policy, |
| - user_settings, active_settings.get(), |
| - profile)); |
|
stevenjb
2017/04/24 17:15:52
This always needs to be called, even if profile is
Kyle Horimoto
2017/04/24 19:49:38
Done.
|
| - callback.Run(service_path, *augmented_properties); |
| + const base::DictionaryValue* network_policy = |
| + guid.empty() ? nullptr : GetByGUID(policies->per_network_config, guid); |
| + const base::DictionaryValue* global_policy = |
| + &policies->global_network_config; |
| + |
| + std::unique_ptr<base::DictionaryValue> augmented_properties( |
| + policy_util::CreateManagedONC(global_policy, network_policy, |
| + user_settings, active_settings.get(), |
| + profile)); |
| + callback.Run(service_path, *augmented_properties); |
| + } else { |
| + callback.Run(service_path, *active_settings); |
| + } |
| } |
| // GetProperties |