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

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

Issue 1317593002: Have SSLErrorHandler decide which type of interstitial to display (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: typo Created 5 years, 4 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 | « chrome/browser/ssl/ssl_error_classification.cc ('k') | chrome/browser/ssl/ssl_error_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ssl/ssl_error_handler.h
diff --git a/chrome/browser/ssl/ssl_error_handler.h b/chrome/browser/ssl/ssl_error_handler.h
index 48bc6746d1c6e14f3e15c6945468a09760ee21b3..30dfb4f4672b051bd8358b04b1c72e510c5e7d48 100644
--- a/chrome/browser/ssl/ssl_error_handler.h
+++ b/chrome/browser/ssl/ssl_error_handler.h
@@ -21,23 +21,28 @@
#include "net/ssl/ssl_info.h"
#include "url/gurl.h"
-class Profile;
class CommonNameMismatchHandler;
+class Profile;
+
+namespace base {
+class Clock;
+}
namespace content {
class RenderViewHost;
class WebContents;
}
-// Decides between showing an SSL warning, showing a captive portal interstitial
-// or redirecting to a name-mismatch suggested URL. This is done by delaying the
-// display of the interstitial for a few seconds (2 by default), and waiting for
-// name-mismatch suggested URL or a captive portal result to arrive during this
-// window. If there is a name mismatch error and a corresponding suggested URL
-// available result arrives in this window, the user is redirected to the
-// suggested URL. Failing that, if a captive portal detected result arrives in
-// the same time window, a captive portal error page is shown. Otherwise, an
-// SSL interstitial is shown.
+// This class is responsible for deciding what type of interstitial to show for
+// an SSL validation error. The display of the interstitial might be delayed by
+// a few seconds (2 by default) while trying to determine the cause of the
+// error. During this window, the class will: check for a clock error, wait for
+// a name-mismatch suggested URL, or wait for a captive portal result to arrive.
+// If there is a name mismatch error and a corresponding suggested URL
+// result arrives in this window, the user is redirected to the suggested URL.
+// Failing that, if a captive portal detected result arrives in the time window,
+// a captive portal error page is shown. If none of these potential error
+// causes match, an SSL interstitial is shown.
//
// This class should only be used on the UI thread because its implementation
// uses captive_portal::CaptivePortalService which can only be accessed on the
@@ -58,11 +63,12 @@ class SSLErrorHandler : public content::WebContentsUserData<SSLErrorHandler>,
scoped_ptr<SSLCertReporter> ssl_cert_reporter,
const base::Callback<void(bool)>& callback);
+ // Testing methods.
static void SetInterstitialDelayForTest(base::TimeDelta delay);
-
// The callback pointer must remain valid for the duration of error handling.
static void SetInterstitialTimerStartedCallbackForTest(
TimerStartedCallback* callback);
+ static void SetClockForTest(base::Clock* testing_clock);
protected:
// The parameters are the same as SSLBlockingPage's constructor.
@@ -94,6 +100,8 @@ class SSLErrorHandler : public content::WebContentsUserData<SSLErrorHandler>,
virtual void ShowCaptivePortalInterstitial(const GURL& landing_url);
virtual void ShowSSLInterstitial();
+ void ShowBadClockInterstitial(const base::Time& now);
+
// Gets the result of whether the suggested URL is valid. Displays
// common name mismatch interstitial or ssl interstitial accordingly.
void CommonNameMismatchHandlerCallback(
« no previous file with comments | « chrome/browser/ssl/ssl_error_classification.cc ('k') | chrome/browser/ssl/ssl_error_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698