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

Unified Diff: chrome/browser/chromeos/net/network_portal_detector_impl.cc

Issue 2923343004: cros: no active portal check when successfully behind portal (Closed)
Patch Set: Created 3 years, 6 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: chrome/browser/chromeos/net/network_portal_detector_impl.cc
diff --git a/chrome/browser/chromeos/net/network_portal_detector_impl.cc b/chrome/browser/chromeos/net/network_portal_detector_impl.cc
index d16ab5718e42d70ef61d2141b0a9c0ebb1068dfe..964cf16d95656fa3f58fcb23dd858345516f2a2b 100644
--- a/chrome/browser/chromeos/net/network_portal_detector_impl.cc
+++ b/chrome/browser/chromeos/net/network_portal_detector_impl.cc
@@ -498,7 +498,19 @@ void NetworkPortalDetectorImpl::OnAttemptCompleted(
attempt_completed_report_.Report();
}
- state_ = STATE_IDLE;
+ // If we are successfully behind captive portal, mark the state so that it
+ // won't schedule detection actively by self.
+ if (result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL &&
+ response_code == 200) {
+ // This can happen when portal provider disconnects us, in which case shill
+ // remains online state.
+ if (network && network->connection_state() == shill::kStateOnline)
+ state_ = STATE_IDLE;
+ else
+ state_ = STATE_BEHIND_PORTAL_IDLE;
stevenjb 2017/06/07 23:00:23 Combine the logic so that this is: if (result ==
Qiang(Joe) Xu 2017/06/07 23:19:13 Done.
+ } else {
+ state_ = STATE_IDLE;
+ }
attempt_timeout_.Cancel();
CaptivePortalState state;

Powered by Google App Engine
This is Rietveld 408576698