Index: chromeos/network/network_state.cc |
diff --git a/chromeos/network/network_state.cc b/chromeos/network/network_state.cc |
index f4ad9599cfa98a0dbaf20eaffe4ca1304873c6e4..1fc045ddf8115049afc4c48f41b2a276191beb72 100644 |
--- a/chromeos/network/network_state.cc |
+++ b/chromeos/network/network_state.cc |
@@ -231,8 +231,11 @@ void NetworkState::GetStateProperties(base::DictionaryValue* dictionary) const { |
profile_path()); |
if (visible()) { |
- if (!error().empty()) |
- dictionary->SetStringWithoutPathExpansion(shill::kErrorProperty, error()); |
+ std::string error_state = GetErrorState(); |
pneubeck (no reviews)
2015/04/13 19:16:11
This change seems to imply that dictionary returne
stevenjb
2015/04/13 21:16:31
Move the logic to ShillToONCTranslator.
|
+ if (!error_state.empty()) { |
+ dictionary->SetStringWithoutPathExpansion(shill::kErrorProperty, |
+ error_state); |
+ } |
dictionary->SetStringWithoutPathExpansion(shill::kStateProperty, |
connection_state()); |
} |
@@ -398,6 +401,12 @@ bool NetworkState::UpdateName(const base::DictionaryValue& properties) { |
return false; |
} |
+std::string NetworkState::GetErrorState() const { |
+ if (ErrorIsValid(error())) |
+ return error(); |
+ return last_error(); |
+} |
+ |
// static |
bool NetworkState::StateIsConnected(const std::string& connection_state) { |
return (connection_state == shill::kStateReady || |