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

Unified Diff: chromeos/network/network_state.cc

Issue 1043343002: Use networkingPrivate.startConnect (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue_430115_internet_options_cellular
Patch Set: Separate out logic and use last_error Created 5 years, 9 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: 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();
+ 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 ||

Powered by Google App Engine
This is Rietveld 408576698