Chromium Code Reviews| Index: chromeos/network/network_connection_handler.cc |
| diff --git a/chromeos/network/network_connection_handler.cc b/chromeos/network/network_connection_handler.cc |
| index f27ff4f8a1a25e74cc6bb8cbc03744a3d91d7d5f..5295b1597bcfa4c70e8262bcba0243a4a720dc57 100644 |
| --- a/chromeos/network/network_connection_handler.cc |
| +++ b/chromeos/network/network_connection_handler.cc |
| @@ -12,13 +12,13 @@ |
| #include "chromeos/dbus/shill_manager_client.h" |
| #include "chromeos/dbus/shill_service_client.h" |
| #include "chromeos/network/client_cert_util.h" |
| -#include "chromeos/network/managed_network_configuration_handler.h" |
| #include "chromeos/network/network_configuration_handler.h" |
| #include "chromeos/network/network_event_log.h" |
| #include "chromeos/network/network_handler_callbacks.h" |
| #include "chromeos/network/network_state.h" |
| #include "chromeos/network/network_state_handler.h" |
| #include "chromeos/network/network_ui_data.h" |
| +#include "chromeos/network/shill_property_util.h" |
| #include "dbus/object_path.h" |
| #include "net/cert/x509_certificate.h" |
| #include "third_party/cros_system_api/dbus/service_constants.h" |
| @@ -47,14 +47,6 @@ bool IsAuthenticationError(const std::string& error) { |
| error == shill::kErrorEapAuthenticationFailed); |
| } |
| -void CopyStringFromDictionary(const base::DictionaryValue& source, |
| - const std::string& key, |
| - base::DictionaryValue* dest) { |
| - std::string string_value; |
| - if (source.GetStringWithoutPathExpansion(key, &string_value)) |
| - dest->SetStringWithoutPathExpansion(key, string_value); |
| -} |
| - |
| bool NetworkRequiresActivation(const NetworkState* network) { |
| return (network->type() == flimflam::kTypeCellular && |
| ((network->activation_state() != flimflam::kActivationStateActivated && |
| @@ -438,7 +430,7 @@ void NetworkConnectionHandler::VerifyConfiguredAndConnect( |
| // Note: Wifi/VPNConfigView set these properties explicitly, in which case |
| // only the TPM must be configured. |
| scoped_ptr<NetworkUIData> ui_data = |
| - ManagedNetworkConfigurationHandler::GetUIData(service_properties); |
| + shill_property_util::GetUIData(service_properties); |
| if (ui_data && ui_data->certificate_type() == CLIENT_CERT_TYPE_PATTERN) { |
| // User must be logged in to connect to a network requiring a certificate. |
| if (!logged_in_ || !cert_loader_) { |
| @@ -483,32 +475,22 @@ void NetworkConnectionHandler::VerifyConfiguredAndConnect( |
| if (!config_properties.empty()) { |
| NET_LOG_EVENT("Configuring Network", service_path); |
| - |
| - // Set configuration properties required by Shill to identify the network. |
| - config_properties.SetStringWithoutPathExpansion( |
| - flimflam::kTypeProperty, type); |
| - CopyStringFromDictionary(service_properties, flimflam::kNameProperty, |
| - &config_properties); |
| - CopyStringFromDictionary(service_properties, flimflam::kGuidProperty, |
| - &config_properties); |
| - if (type == flimflam::kTypeVPN) { |
| - config_properties.SetStringWithoutPathExpansion( |
| - flimflam::kProviderTypeProperty, vpn_provider_type); |
| - config_properties.SetStringWithoutPathExpansion( |
| - flimflam::kProviderHostProperty, vpn_provider_host); |
| - } else if (type == flimflam::kTypeWifi) { |
| - config_properties.SetStringWithoutPathExpansion( |
| - flimflam::kSecurityProperty, security); |
| + if (shill_property_util::CopyIdentifyingProperties(service_properties, |
| + &config_properties)) { |
| + network_configuration_handler_->SetProperties( |
| + service_path, |
| + config_properties, |
| + base::Bind(&NetworkConnectionHandler::CallShillConnect, |
| + AsWeakPtr(), |
| + service_path), |
| + base::Bind(&NetworkConnectionHandler::HandleConfigurationFailure, |
| + AsWeakPtr(), |
| + service_path)); |
| + return; |
| + } else { |
|
stevenjb
2013/08/28 15:33:54
no else after return
pneubeck (no reviews)
2013/09/02 13:39:54
Done.
|
| + NET_LOG_ERROR("Shill dictionary is missing some relevant entries", |
| + service_path); |
| } |
| - |
| - network_configuration_handler_->SetProperties( |
| - service_path, |
| - config_properties, |
| - base::Bind(&NetworkConnectionHandler::CallShillConnect, |
| - AsWeakPtr(), service_path), |
| - base::Bind(&NetworkConnectionHandler::HandleConfigurationFailure, |
| - AsWeakPtr(), service_path)); |
| - return; |
| } |
| // Otherwise, we probably still need to configure the network since |