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

Unified Diff: chrome/browser/ssl/ssl_error_handler.cc

Issue 819443003: Add finch gate for captive portal interstitial. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix unit tests 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
Index: chrome/browser/ssl/ssl_error_handler.cc
diff --git a/chrome/browser/ssl/ssl_error_handler.cc b/chrome/browser/ssl/ssl_error_handler.cc
index 552902cb187deaaccc96ba88a8ff6447041644f0..708162fe3fbeab9c176f8c8b962a897678c23f6a 100644
--- a/chrome/browser/ssl/ssl_error_handler.cc
+++ b/chrome/browser/ssl/ssl_error_handler.cc
@@ -71,6 +71,11 @@ base::TimeDelta GetInterstitialDisplayDelay(
}
return base::TimeDelta();
}
+
+bool IsCaptivePortalInterstitialEnabled() {
+ return base::FieldTrialList::FindFullName("CaptivePortalInterstitial") ==
+ "Enabled";
+}
#endif
} // namespace
@@ -143,16 +148,18 @@ void SSLErrorHandler::StartHandlingError() {
RecordUMA(HANDLE_ALL);
#if defined(ENABLE_CAPTIVE_PORTAL_DETECTION)
- CheckForCaptivePortal();
- timer_.Start(FROM_HERE,
- GetInterstitialDisplayDelay(g_interstitial_delay_type),
- this, &SSLErrorHandler::OnTimerExpired);
- if (g_timer_started_callback)
- g_timer_started_callback->Run(web_contents_);
-#else
+ if (IsCaptivePortalInterstitialEnabled()) {
+ CheckForCaptivePortal();
+ timer_.Start(FROM_HERE,
+ GetInterstitialDisplayDelay(g_interstitial_delay_type),
+ this, &SSLErrorHandler::OnTimerExpired);
+ if (g_timer_started_callback)
+ g_timer_started_callback->Run(web_contents_);
+ return;
+ }
+#endif
// Display an SSL interstitial.
ShowSSLInterstitial();
-#endif
}
void SSLErrorHandler::OnTimerExpired() {
« no previous file with comments | « chrome/browser/captive_portal/captive_portal_browsertest.cc ('k') | chrome/browser/ssl/ssl_error_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698