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

Unified Diff: chromeos/network/network_state.cc

Issue 1722453002: Extend vpnProvider to allow reconnections (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: update comment Created 4 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
« no previous file with comments | « chromeos/network/network_state.h ('k') | extensions/browser/api/vpn_provider/vpn_provider_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chromeos/network/network_state.cc
diff --git a/chromeos/network/network_state.cc b/chromeos/network/network_state.cc
index 6c022bff17820ad8e68c3eca75d949aa4211e7d0..df5f8255289ee11f48187d12f987d3ef728cbd7c 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
« no previous file with comments | « chromeos/network/network_state.h ('k') | extensions/browser/api/vpn_provider/vpn_provider_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698