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

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

Issue 873713004: Introduce NetworkState::is_captive_portal() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Feedback, unit test Created 5 years, 11 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 | « no previous file | chrome/browser/ui/webui/chromeos/login/network_state_informer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3dbe501ab926f8386fc645ce19847a561e3e37bf..c83cc0d1ac59078b516cdaf7db18f2cb8870ca06 100644
--- a/chrome/browser/chromeos/net/network_portal_detector_impl.cc
+++ b/chrome/browser/chromeos/net/network_portal_detector_impl.cc
@@ -96,7 +96,7 @@ void RecordDiscrepancyWithShill(
NetworkPortalDetectorImpl::kSessionShillOnlineHistogram,
status,
NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT);
- } else if (network->connection_state() == shill::kStatePortal) {
+ } else if (network->is_captive_portal()) {
UMA_HISTOGRAM_ENUMERATION(
NetworkPortalDetectorImpl::kSessionShillPortalHistogram,
status,
@@ -113,7 +113,7 @@ void RecordDiscrepancyWithShill(
NetworkPortalDetectorImpl::kOobeShillOnlineHistogram,
status,
NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_COUNT);
- } else if (network->connection_state() == shill::kStatePortal) {
+ } else if (network->is_captive_portal()) {
UMA_HISTOGRAM_ENUMERATION(
NetworkPortalDetectorImpl::kOobeShillPortalHistogram,
status,
@@ -480,7 +480,7 @@ void NetworkPortalDetectorImpl::OnAttemptCompleted(
// if the default network is in portal state.
if (result != captive_portal::RESULT_NO_RESPONSE &&
DBusThreadManager::Get()->GetShillProfileClient()->GetTestInterface() &&
- network && network->connection_state() == shill::kStatePortal) {
+ network && network->is_captive_portal()) {
result = captive_portal::RESULT_BEHIND_CAPTIVE_PORTAL;
response_code = 200;
}
@@ -502,8 +502,7 @@ void NetworkPortalDetectorImpl::OnAttemptCompleted(
case captive_portal::RESULT_NO_RESPONSE:
if (state.response_code == net::HTTP_PROXY_AUTHENTICATION_REQUIRED) {
state.status = CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED;
- } else if (network &&
- (network->connection_state() == shill::kStatePortal)) {
+ } else if (network && network->is_captive_portal()) {
// Take into account shill's detection results.
state.status = CAPTIVE_PORTAL_STATUS_PORTAL;
} else {
@@ -618,17 +617,15 @@ void NetworkPortalDetectorImpl::RecordDetectionStats(
NOTREACHED();
break;
case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_OFFLINE:
- if (network->connection_state() == shill::kStateOnline ||
- network->connection_state() == shill::kStatePortal) {
+ if (network->IsConnectedState())
RecordDiscrepancyWithShill(network, status);
- }
break;
case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_ONLINE:
if (network->connection_state() != shill::kStateOnline)
RecordDiscrepancyWithShill(network, status);
break;
case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PORTAL:
- if (network->connection_state() != shill::kStatePortal)
+ if (!network->is_captive_portal())
RecordDiscrepancyWithShill(network, status);
break;
case NetworkPortalDetector::CAPTIVE_PORTAL_STATUS_PROXY_AUTH_REQUIRED:
« no previous file with comments | « no previous file | chrome/browser/ui/webui/chromeos/login/network_state_informer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698