Chromium Code Reviews| 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; |