Chromium Code Reviews| Index: ui/chromeos/network/network_state_notifier.cc |
| diff --git a/ui/chromeos/network/network_state_notifier.cc b/ui/chromeos/network/network_state_notifier.cc |
| index a5b5ac5308973501e54f1611d8b7a35ee194d3a7..6a9b36a942cc9373763b8f5eec4942239d49aa6f 100644 |
| --- a/ui/chromeos/network/network_state_notifier.cc |
| +++ b/ui/chromeos/network/network_state_notifier.cc |
| @@ -100,6 +100,7 @@ NetworkStateNotifier::NetworkStateNotifier(NetworkConnect* network_connect) |
| NetworkStateHandler* handler = NetworkHandler::Get()->network_state_handler(); |
| handler->AddObserver(this, FROM_HERE); |
| UpdateDefaultNetwork(handler->DefaultNetwork()); |
| + NetworkHandler::Get()->network_connection_handler()->AddObserver(this); |
| } |
| NetworkStateNotifier::~NetworkStateNotifier() { |
| @@ -107,6 +108,20 @@ NetworkStateNotifier::~NetworkStateNotifier() { |
| return; |
| NetworkHandler::Get()->network_state_handler()->RemoveObserver(this, |
| FROM_HERE); |
| + NetworkHandler::Get()->network_connection_handler()->RemoveObserver(this); |
| +} |
| + |
| +void NetworkStateNotifier::ConnectFailed(const std::string& service_path, |
| + const std::string& error_name) { |
| + // Only show a notification for recognized errors. Other failures are expected |
|
pneubeck (no reviews)
2015/01/04 16:57:00
What means 'recognized'? kErrorConnectFailed does
stevenjb
2015/01/09 18:18:03
s/recognized/certain.
Clarified the comment for k
|
| + // to be handled by the UI that initiated the connect request. |
| + if (error_name != NetworkConnectionHandler::kErrorConnectFailed && |
| + error_name != NetworkConnectionHandler::kErrorNotFound && |
| + error_name != NetworkConnectionHandler::kErrorConfigureFailed && |
| + error_name != NetworkConnectionHandler::kErrorCertLoadTimeout) { |
| + return; |
| + } |
| + ShowNetworkConnectError(error_name, service_path); |
| } |
| void NetworkStateNotifier::DefaultNetworkChanged(const NetworkState* network) { |
| @@ -316,7 +331,7 @@ void NetworkStateNotifier::ShowConnectErrorNotification( |
| return; |
| } |
| - error = network_connect_->GetErrorString(shill_error, service_path); |
| + error = network_connect_->GetShillErrorString(shill_error, service_path); |
| if (error.empty()) |
| error = l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN); |
| } |