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

Unified Diff: chrome/browser/captive_portal/captive_portal_service.cc

Issue 318213002: Add custom interstitial for captive portals. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove notification, add observer for SSLErrorHandler timer. Created 6 years 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/captive_portal/captive_portal_service.cc
diff --git a/chrome/browser/captive_portal/captive_portal_service.cc b/chrome/browser/captive_portal/captive_portal_service.cc
index 93c37a8c1b81f69c8f9c174e934e7a1276f8a3bd..d38611749b65393deeba27491be589f4c3cebece 100644
--- a/chrome/browser/captive_portal/captive_portal_service.cc
+++ b/chrome/browser/captive_portal/captive_portal_service.cc
@@ -214,6 +214,10 @@ CaptivePortalService::~CaptivePortalService() {
void CaptivePortalService::DetectCaptivePortal() {
DCHECK(CalledOnValidThread());
+ // Detection should be disabled only in tests.
+ if (testing_state_ == IGNORE_REQUESTS_FOR_TESTING)
+ return;
+
// If a request is pending or running, do nothing.
if (state_ == STATE_CHECKING_FOR_PORTAL || state_ == STATE_TIMER_RUNNING)
return;
@@ -356,6 +360,7 @@ void CaptivePortalService::UpdateEnabledState() {
resolve_errors_with_web_service_.GetValue();
if (testing_state_ != SKIP_OS_CHECK_FOR_TESTING &&
+ testing_state_ != IGNORE_REQUESTS_FOR_TESTING &&
ShouldDeferToNativeCaptivePortalDetection()) {
enabled_ = false;
}

Powered by Google App Engine
This is Rietveld 408576698