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

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: steven's feedback 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..37b92dd5419e4e40b46b86a8353d5fb10e3e96d4 100644
--- a/chrome/browser/chromeos/net/network_portal_detector_impl.cc
+++ b/chrome/browser/chromeos/net/network_portal_detector_impl.cc
@@ -498,7 +498,18 @@ void NetworkPortalDetectorImpl::OnAttemptCompleted(
attempt_completed_report_.Report();
}
- state_ = STATE_IDLE;
+ // If Chrome portal detection successfully returns portal state, mark the
+ // state so that Chrome won't schedule detection actively by self.
+ // The exception is when portal side session expires, shill doesn't report
+ // network connection state changed from online to portal. Thus we enable
+ // Chrome's detection by still marking |state_| to STATE_IDLE.
+ if (result == captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL &&
+ response_code == 200 &&
+ (!network || network->connection_state() != shill::kStateOnline)) {
+ state_ = STATE_BEHIND_PORTAL_IDLE;
+ } else {
+ state_ = STATE_IDLE;
+ }
attempt_timeout_.Cancel();
CaptivePortalState state;

Powered by Google App Engine
This is Rietveld 408576698