Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3417)

Unified Diff: ash/system/chromeos/network/network_connect.cc

Issue 23522050: Provide Shill Error to failure notification (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/system/chromeos/network/network_state_notifier.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/system/chromeos/network/network_connect.cc
diff --git a/ash/system/chromeos/network/network_connect.cc b/ash/system/chromeos/network/network_connect.cc
index 23fd8d990a1ab5aefc4217433b4ce027c9117892..d0765cc217780bc5c4b1634a95694041b65f7902 100644
--- a/ash/system/chromeos/network/network_connect.cc
+++ b/ash/system/chromeos/network/network_connect.cc
@@ -58,10 +58,11 @@ bool IsDirectActivatedCarrier(const std::string& carrier) {
return false;
}
-void ShowErrorNotification(const std::string& error,
+void ShowErrorNotification(const std::string& error_name,
+ const std::string& shill_error,
const std::string& service_path) {
Shell::GetInstance()->system_tray_notifier()->network_state_notifier()->
- ShowNetworkConnectError(error, service_path);
+ ShowNetworkConnectError(error_name, shill_error, service_path);
}
void OnConnectFailed(const std::string& service_path,
@@ -104,7 +105,10 @@ void OnConnectFailed(const std::string& service_path,
}
// ConnectFailed or unknown error; show a notification.
- ShowErrorNotification(error_name, service_path);
+ std::string shill_error;
+ error_data.get()->GetString(
+ chromeos::network_handler::kErrorDetail, &shill_error);
+ ShowErrorNotification(error_name, shill_error, service_path);
// Show a configure dialog for ConnectFailed errors.
if (error_name != flimflam::kErrorConnectFailed)
@@ -153,7 +157,8 @@ void OnActivateFailed(const std::string& service_path,
const std::string& error_name,
scoped_ptr<base::DictionaryValue> error_data) {
NET_LOG_ERROR("Unable to activate network", service_path);
- ShowErrorNotification(network_connect::kErrorActivateFailed, service_path);
+ ShowErrorNotification(
+ network_connect::kErrorActivateFailed, "", service_path);
}
void OnActivateSucceeded(const std::string& service_path) {
@@ -163,7 +168,8 @@ void OnActivateSucceeded(const std::string& service_path) {
void OnConfigureFailed(const std::string& error_name,
scoped_ptr<base::DictionaryValue> error_data) {
NET_LOG_ERROR("Unable to configure network", "");
- ShowErrorNotification(NetworkConnectionHandler::kErrorConfigureFailed, "");
+ ShowErrorNotification(
+ NetworkConnectionHandler::kErrorConfigureFailed, "", "");
}
void OnConfigureSucceeded(const std::string& service_path) {
@@ -180,7 +186,7 @@ void SetPropertiesFailed(const std::string& desc,
scoped_ptr<base::DictionaryValue> error_data) {
NET_LOG_ERROR(desc + ": Failed: " + config_error_name, service_path);
ShowErrorNotification(
- NetworkConnectionHandler::kErrorConfigureFailed, service_path);
+ NetworkConnectionHandler::kErrorConfigureFailed, "", service_path);
}
void SetPropertiesToClear(base::DictionaryValue* properties_to_set,
@@ -405,7 +411,7 @@ void ConfigureNetworkAndConnect(const std::string& service_path,
std::string profile_path;
if (!GetNetworkProfilePath(shared, &profile_path)) {
ShowErrorNotification(
- NetworkConnectionHandler::kErrorConfigureFailed, service_path);
+ NetworkConnectionHandler::kErrorConfigureFailed, "", service_path);
return;
}
NetworkHandler::Get()->network_configuration_handler()->SetNetworkProfile(
@@ -421,7 +427,8 @@ void CreateConfigurationAndConnect(base::DictionaryValue* properties,
NET_LOG_USER("CreateConfigurationAndConnect", "");
std::string profile_path;
if (!GetNetworkProfilePath(shared, &profile_path)) {
- ShowErrorNotification(NetworkConnectionHandler::kErrorConfigureFailed, "");
+ ShowErrorNotification(
+ NetworkConnectionHandler::kErrorConfigureFailed, "", "");
return;
}
properties->SetStringWithoutPathExpansion(
« no previous file with comments | « no previous file | ash/system/chromeos/network/network_state_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698