summaryrefslogtreecommitdiffstats
path: root/chrome/browser/ssl/ssl_error_handler.h
diff options
context:
space:
mode:
authorbhanudev <bhanudev@google.com>2015-08-18 15:21:18 -0700
committerCommit bot <commit-bot@chromium.org>2015-08-18 22:22:06 +0000
commit2051ce7a01a4026ec1611c940a3d83a55a6e19ef (patch)
tree2409169e8a1e7262b718cd16842504dce8bf6d3e /chrome/browser/ssl/ssl_error_handler.h
parent75eee56c732dd56ad5c733db0c4522adc8ce5029 (diff)
downloadchromium_src-2051ce7a01a4026ec1611c940a3d83a55a6e19ef.zip
chromium_src-2051ce7a01a4026ec1611c940a3d83a55a6e19ef.tar.gz
chromium_src-2051ce7a01a4026ec1611c940a3d83a55a6e19ef.tar.bz2
Common Name Mismatch Handler For WWW Subdomain Mismatch case
This CL displays a modified interstitial for the WWW subdomain mismatch error. When there is a WWW sub domain mismatch between the hostname entered in the URL and the dns name present in the certificate, we ping the www mismatched domain. If a valid response code is received, we display an interstitial with a link to that domain. BUG=507454 Review URL: https://codereview.chromium.org/1223233002 Cr-Commit-Position: refs/heads/master@{#344052}
Diffstat (limited to 'chrome/browser/ssl/ssl_error_handler.h')
-rw-r--r--chrome/browser/ssl/ssl_error_handler.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/chrome/browser/ssl/ssl_error_handler.h b/chrome/browser/ssl/ssl_error_handler.h
index 601baf0..025eb1b 100644
--- a/chrome/browser/ssl/ssl_error_handler.h
+++ b/chrome/browser/ssl/ssl_error_handler.h
@@ -11,6 +11,8 @@
#include "base/macros.h"
#include "base/timer/timer.h"
#include "chrome/browser/chrome_notification_types.h"
+#include "chrome/browser/profiles/profile.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"
@@ -19,6 +21,9 @@
#include "net/ssl/ssl_info.h"
#include "url/gurl.h"
+class Profile;
+class CommonNameMismatchHandler;
+
namespace content {
class RenderViewHost;
class WebContents;
@@ -61,6 +66,12 @@ class SSLErrorHandler : public content::WebContentsUserData<SSLErrorHandler>,
static void SetInterstitialTimerStartedCallbackForTest(
TimerStartedCallback* callback);
+ // Gets the result of whether the suggested URL is valid. Displays
+ // common name mismatch interstitial or ssl interstitial accordingly.
+ void CommonNameMismatchHandlerCallback(
+ const CommonNameMismatchHandler::SuggestedUrlCheckResult& result,
+ const GURL& suggested_url);
+
protected:
SSLErrorHandler(content::WebContents* web_contents,
int cert_error,
@@ -89,6 +100,10 @@ class SSLErrorHandler : public content::WebContentsUserData<SSLErrorHandler>,
virtual void CheckForCaptivePortal();
virtual void ShowCaptivePortalInterstitial(const GURL& landing_url);
virtual void ShowSSLInterstitial();
+ virtual bool GetSuggestedUrl(const std::vector<std::string>& dns_names,
+ GURL* suggested_url) const;
+ virtual void CheckSuggestedUrl(const GURL& suggested_url);
+ virtual void NavigateToSuggestedURL(const GURL& suggested_url);
// content::NotificationObserver:
void Observe(
@@ -114,10 +129,13 @@ class SSLErrorHandler : public content::WebContentsUserData<SSLErrorHandler>,
const GURL request_url_;
const int options_mask_;
base::Callback<void(bool)> callback_;
+ Profile* const profile_;
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);