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

Unified Diff: ash/system/chromeos/network/network_state_notifier.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
Index: ash/system/chromeos/network/network_state_notifier.cc
diff --git a/ash/system/chromeos/network/network_state_notifier.cc b/ash/system/chromeos/network/network_state_notifier.cc
index 634aca4b76665435aad6cebe130f3974f66b6853..778b9a9fb52f74fb7ca8e71ef0de3adbb69134d9 100644
--- a/ash/system/chromeos/network/network_state_notifier.cc
+++ b/ash/system/chromeos/network/network_state_notifier.cc
@@ -196,46 +196,58 @@ void NetworkStateNotifier::UpdateCellularActivating(
void NetworkStateNotifier::ShowNetworkConnectError(
const std::string& error_name,
+ const std::string& shill_error,
const std::string& service_path) {
if (service_path.empty()) {
base::DictionaryValue shill_properties;
- ShowConnectErrorNotification(error_name, service_path, shill_properties);
+ ShowConnectErrorNotification(error_name, shill_error, service_path,
+ shill_properties);
return;
}
// Get the up-to-date properties for the network and display the error.
NetworkHandler::Get()->network_configuration_handler()->GetProperties(
service_path,
base::Bind(&NetworkStateNotifier::ConnectErrorPropertiesSucceeded,
- weak_ptr_factory_.GetWeakPtr(), error_name),
+ weak_ptr_factory_.GetWeakPtr(), error_name, shill_error),
base::Bind(&NetworkStateNotifier::ConnectErrorPropertiesFailed,
- weak_ptr_factory_.GetWeakPtr(), error_name, service_path));
+ weak_ptr_factory_.GetWeakPtr(), error_name, shill_error,
+ service_path));
}
void NetworkStateNotifier::ConnectErrorPropertiesSucceeded(
const std::string& error_name,
+ const std::string& shill_error,
const std::string& service_path,
const base::DictionaryValue& shill_properties) {
- ShowConnectErrorNotification(error_name, service_path, shill_properties);
+ ShowConnectErrorNotification(error_name, shill_error, service_path,
+ shill_properties);
}
void NetworkStateNotifier::ConnectErrorPropertiesFailed(
const std::string& error_name,
+ const std::string& shill_error,
const std::string& service_path,
- const std::string& shill_error_name,
+ const std::string& shill_connect_error,
scoped_ptr<base::DictionaryValue> shill_error_data) {
base::DictionaryValue shill_properties;
- ShowConnectErrorNotification(error_name, service_path, shill_properties);
+ ShowConnectErrorNotification(error_name, shill_error, service_path,
+ shill_properties);
}
void NetworkStateNotifier::ShowConnectErrorNotification(
const std::string& error_name,
+ const std::string& shill_error,
const std::string& service_path,
const base::DictionaryValue& shill_properties) {
string16 error = GetConnectErrorString(error_name);
if (error.empty()) {
- std::string network_error;
- shill_properties.GetStringWithoutPathExpansion(
- flimflam::kErrorProperty, &network_error);
+ // Service.Error gets cleared shortly after State transitions to Failure,
+ // so rely on |shill_error| unless empty.
+ std::string network_error = shill_error;
+ if (network_error.empty()) {
+ shill_properties.GetStringWithoutPathExpansion(
+ flimflam::kErrorProperty, &network_error);
+ }
error = network_connect::ErrorString(network_error);
if (error.empty())
error = l10n_util::GetStringUTF16(IDS_CHROMEOS_NETWORK_ERROR_UNKNOWN);
« no previous file with comments | « ash/system/chromeos/network/network_state_notifier.h ('k') | chromeos/network/network_connection_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698