diff options
author | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-01 16:28:13 +0000 |
---|---|---|
committer | stevenjb@chromium.org <stevenjb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-10-01 16:28:13 +0000 |
commit | ebecfb068bcfc514f5d4310acd6b6b5b9c772a77 (patch) | |
tree | a8a1fa9f3f066404d4b67bccc3a2b2b3e57dd351 /ash | |
parent | d7a7c8066134dc6e736ee8a16117cd66c6b8d92e (diff) | |
download | chromium_src-ebecfb068bcfc514f5d4310acd6b6b5b9c772a77.zip chromium_src-ebecfb068bcfc514f5d4310acd6b6b5b9c772a77.tar.gz chromium_src-ebecfb068bcfc514f5d4310acd6b6b5b9c772a77.tar.bz2 |
Use EapMethod to provide correct network error message
BUG=297374
R=pneubeck@chromium.org
Review URL: https://codereview.chromium.org/24644005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@226246 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r-- | ash/ash_chromeos_strings.grdp | 3 | ||||
-rw-r--r-- | ash/system/chromeos/network/network_connect.cc | 32 | ||||
-rw-r--r-- | ash/system/chromeos/network/network_connect.h | 3 | ||||
-rw-r--r-- | ash/system/chromeos/network/network_state_notifier.cc | 2 |
4 files changed, 29 insertions, 11 deletions
diff --git a/ash/ash_chromeos_strings.grdp b/ash/ash_chromeos_strings.grdp index 3f164de..8adf94c 100644 --- a/ash/ash_chromeos_strings.grdp +++ b/ash/ash_chromeos_strings.grdp @@ -253,6 +253,9 @@ Server message: <ph name="server_msg">$3<ex>Incorrect password</ex></ph> <message name="IDS_CHROMEOS_NETWORK_ERROR_EAP_REMOTE_TLS_FAILED" desc="Network error details in notifications: EAP_REMOTE_TLS_FAILED"> Authentication certificate rejected remotely </message> + <message name="IDS_CHROMEOS_NETWORK_ERROR_EAP_AUTH_FAILED" desc="Network error details in notifications: IPSEC_CERT_AUTH_FAILED"> + Username/password incorrect or EAP-auth failed + </message> <message name="IDS_CHROMEOS_NETWORK_ERROR_PPP_AUTH_FAILED" desc="Network error details in notifications: PPP_AUTH_FAILED"> PPP authentication failed due to an incorrect username or password </message> diff --git a/ash/system/chromeos/network/network_connect.cc b/ash/system/chromeos/network/network_connect.cc index fa979d9..196f3b2 100644 --- a/ash/system/chromeos/network/network_connect.cc +++ b/ash/system/chromeos/network/network_connect.cc @@ -260,6 +260,11 @@ void ConfigureSetProfileSucceeded( base::Bind(&SetPropertiesFailed, "SetProperties", service_path)); } +const NetworkState* GetNetworkState(const std::string& service_path) { + return NetworkHandler::Get()->network_state_handler()-> + GetNetworkState(service_path); +} + } // namespace namespace network_connect { @@ -274,9 +279,7 @@ const char kErrorActivateFailed[] = "activate-failed"; void ConnectToNetwork(const std::string& service_path, gfx::NativeWindow owning_window) { NET_LOG_USER("ConnectToNetwork", service_path); - const NetworkState* network = - NetworkHandler::Get()->network_state_handler()-> - GetNetworkState(service_path); + const NetworkState* network = GetNetworkState(service_path); if (network && !network->error().empty()) { NET_LOG_USER("Configure: " + network->error(), service_path); // If the network is in an error state, show the configuration UI directly @@ -342,9 +345,7 @@ void SetTechnologyEnabled(const NetworkTypePattern& technology, void ActivateCellular(const std::string& service_path) { NET_LOG_USER("ActivateCellular", service_path); - const NetworkState* cellular = - NetworkHandler::Get()->network_state_handler()-> - GetNetworkState(service_path); + const NetworkState* cellular = GetNetworkState(service_path); if (!cellular || cellular->type() != shill::kTypeCellular) { NET_LOG_ERROR("ActivateCellular with no Service", service_path); return; @@ -439,7 +440,8 @@ void CreateConfigurationAndConnect(base::DictionaryValue* properties, base::Bind(&OnConfigureFailed)); } -string16 ErrorString(const std::string& error) { +string16 ErrorString(const std::string& error, + const std::string& service_path) { if (error.empty()) return string16(); if (error == shill::kErrorOutOfRange) @@ -482,11 +484,23 @@ string16 ErrorString(const std::string& error) { return l10n_util::GetStringUTF16( IDS_CHROMEOS_NETWORK_ERROR_IPSEC_PSK_AUTH_FAILED); } - if (error == shill::kErrorIpsecCertAuthFailed || - error == shill::kErrorEapAuthenticationFailed) { + if (error == shill::kErrorIpsecCertAuthFailed) { return l10n_util::GetStringUTF16( IDS_CHROMEOS_NETWORK_ERROR_CERT_AUTH_FAILED); } + if (error == shill::kErrorEapAuthenticationFailed) { + const NetworkState* network = GetNetworkState(service_path); + // TLS always requires a client certificate, so show a cert auth + // failed message for TLS. Other EAP methods do not generally require + // a client certicate. + if (network && network->eap_method() == shill::kEapMethodTLS) { + return l10n_util::GetStringUTF16( + IDS_CHROMEOS_NETWORK_ERROR_CERT_AUTH_FAILED); + } else { + return l10n_util::GetStringUTF16( + IDS_CHROMEOS_NETWORK_ERROR_EAP_AUTH_FAILED); + } + } if (error == shill::kErrorEapLocalTlsFailed) { return l10n_util::GetStringUTF16( IDS_CHROMEOS_NETWORK_ERROR_EAP_LOCAL_TLS_FAILED); diff --git a/ash/system/chromeos/network/network_connect.h b/ash/system/chromeos/network/network_connect.h index 0c504be..0d30d22 100644 --- a/ash/system/chromeos/network/network_connect.h +++ b/ash/system/chromeos/network/network_connect.h @@ -60,7 +60,8 @@ ASH_EXPORT void CreateConfigurationAndConnect(base::DictionaryValue* properties, bool shared); // Returns the localized string for shill error string |error|. -ASH_EXPORT base::string16 ErrorString(const std::string& error); +ASH_EXPORT base::string16 ErrorString(const std::string& error, + const std::string& service_path); // Shows the settings for the network specified by |service_path|. If empty, // or no matching network exists, shows the general internet settings page. diff --git a/ash/system/chromeos/network/network_state_notifier.cc b/ash/system/chromeos/network/network_state_notifier.cc index 2ade6b9..addbc9d 100644 --- a/ash/system/chromeos/network/network_state_notifier.cc +++ b/ash/system/chromeos/network/network_state_notifier.cc @@ -248,7 +248,7 @@ void NetworkStateNotifier::ShowConnectErrorNotification( shill_properties.GetStringWithoutPathExpansion( shill::kErrorProperty, &network_error); } - error = network_connect::ErrorString(network_error); + error = network_connect::ErrorString(network_error, service_path); if (error.empty()) error = l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN); } |