diff options
Diffstat (limited to 'chromeos/network/network_state.cc')
-rw-r--r-- | chromeos/network/network_state.cc | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/chromeos/network/network_state.cc b/chromeos/network/network_state.cc index 6c022bf..df5f825 100644 --- a/chromeos/network/network_state.cc +++ b/chromeos/network/network_state.cc @@ -90,7 +90,14 @@ bool NetworkState::PropertyChanged(const std::string& key, if (key == shill::kSignalStrengthProperty) { return GetIntegerValue(key, value, &signal_strength_); } else if (key == shill::kStateProperty) { - return GetStringValue(key, value, &connection_state_); + std::string saved_state = connection_state_; + if (GetStringValue(key, value, &connection_state_)) { + if (connection_state_ != saved_state) + last_connection_state_ = saved_state; + return true; + } else { + return false; + } } else if (key == shill::kVisibleProperty) { return GetBooleanValue(key, value, &visible_); } else if (key == shill::kConnectableProperty) { @@ -350,6 +357,11 @@ bool NetworkState::IsConnectingState() const { return visible() && StateIsConnecting(connection_state_); } +bool NetworkState::IsReconnecting() const { + return visible() && StateIsConnecting(connection_state_) && + StateIsConnected(last_connection_state_); +} + bool NetworkState::IsInProfile() const { // kTypeEthernetEap is always saved. We need this check because it does // not show up in the visible list, but its properties may not be available |