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

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

Issue 1223233002: Common Name Mismatch Handler For WWW Subdomain Mismatch case (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Resolving Comments Created 5 years, 5 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.h
diff --git a/chrome/browser/ssl/ssl_error_handler.h b/chrome/browser/ssl/ssl_error_handler.h
index 49f0c35e7cce28dec9d9ef5058ee572f06282ab0..8a4a694483cff98723d54bc3290f9666ca68a1b0 100644
--- a/chrome/browser/ssl/ssl_error_handler.h
+++ b/chrome/browser/ssl/ssl_error_handler.h
@@ -11,6 +11,7 @@
#include "base/macros.h"
#include "base/timer/timer.h"
#include "chrome/browser/chrome_notification_types.h"
+#include "chrome/browser/ssl/common_name_mismatch_handler.h"
#include "chrome/browser/ssl/ssl_cert_reporter.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
@@ -61,6 +62,11 @@ class SSLErrorHandler : public content::WebContentsUserData<SSLErrorHandler>,
static void SetInterstitialTimerStartedCallbackForTest(
TimerStartedCallback* callback);
+ // Gets the result of whether the suggested url is valid. Displays
palmer 2015/07/17 00:16:00 Nit: URL, SSL. In general, make sure all your acro
Bhanu Dev 2015/07/23 20:11:06 Done.
+ // common name mismatch interstitial or ssl interstitial accordingly.
+ void CommonNameMismatchHandlerCallback(
+ const CommonNameMismatchHandler::Results& results);
+
protected:
SSLErrorHandler(content::WebContents* web_contents,
int cert_error,
@@ -88,7 +94,11 @@ class SSLErrorHandler : public content::WebContentsUserData<SSLErrorHandler>,
// These are virtual for tests:
virtual void CheckForCaptivePortal();
virtual void ShowCaptivePortalInterstitial(const GURL& landing_url);
- virtual void ShowSSLInterstitial();
+ virtual void ShowSSLInterstitial(const GURL& suggested_url);
+ virtual bool GetSuggestedUrl(const GURL& request_url,
+ const std::vector<std::string>& dns_names,
+ GURL* suggested_url);
+ virtual void CheckSuggestedUrl(const GURL& suggested_url);
// content::NotificationObserver:
void Observe(
@@ -101,6 +111,9 @@ class SSLErrorHandler : public content::WebContentsUserData<SSLErrorHandler>,
const GURL& url,
content::NavigationController::ReloadType reload_type) override;
+ // Timer duration for common name mismatch handler url check.
+ const int common_name_handler_delay_in_seconds = 3;
+
content::WebContents* web_contents_;
const int cert_error_;
const net::SSLInfo ssl_info_;
@@ -111,6 +124,8 @@ class SSLErrorHandler : public content::WebContentsUserData<SSLErrorHandler>,
content::NotificationRegistrar registrar_;
base::OneShotTimer<SSLErrorHandler> timer_;
+ scoped_ptr<CommonNameMismatchHandler> common_name_mismatch_handler_;
+
scoped_ptr<SSLCertReporter> ssl_cert_reporter_;
DISALLOW_COPY_AND_ASSIGN(SSLErrorHandler);

Powered by Google App Engine
This is Rietveld 408576698