| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ |
| 6 #define CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ | 6 #define CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/callback_forward.h" | 10 #include "base/callback_forward.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/timer/timer.h" | 12 #include "base/timer/timer.h" |
| 13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/ssl/common_name_mismatch_handler.h" | 15 #include "chrome/browser/ssl/common_name_mismatch_handler.h" |
| 16 #include "chrome/browser/ssl/ssl_cert_reporter.h" | 16 #include "chrome/browser/ssl/ssl_cert_reporter.h" |
| 17 #include "components/ssl_errors/error_classification.h" | 17 #include "components/ssl_errors/error_classification.h" |
| 18 #include "content/public/browser/notification_observer.h" | 18 #include "content/public/browser/notification_observer.h" |
| 19 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
| 20 #include "content/public/browser/restore_type.h" |
| 20 #include "content/public/browser/web_contents_observer.h" | 21 #include "content/public/browser/web_contents_observer.h" |
| 21 #include "content/public/browser/web_contents_user_data.h" | 22 #include "content/public/browser/web_contents_user_data.h" |
| 22 #include "net/ssl/ssl_info.h" | 23 #include "net/ssl/ssl_info.h" |
| 23 #include "url/gurl.h" | 24 #include "url/gurl.h" |
| 24 | 25 |
| 25 class CommonNameMismatchHandler; | 26 class CommonNameMismatchHandler; |
| 26 class Profile; | 27 class Profile; |
| 27 | 28 |
| 28 namespace base { | 29 namespace base { |
| 29 class Clock; | 30 class Clock; |
| (...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 private: | 115 private: |
| 115 // content::NotificationObserver: | 116 // content::NotificationObserver: |
| 116 void Observe( | 117 void Observe( |
| 117 int type, | 118 int type, |
| 118 const content::NotificationSource& source, | 119 const content::NotificationSource& source, |
| 119 const content::NotificationDetails& details) override; | 120 const content::NotificationDetails& details) override; |
| 120 | 121 |
| 121 // content::WebContentsObserver: | 122 // content::WebContentsObserver: |
| 122 void DidStartNavigationToPendingEntry( | 123 void DidStartNavigationToPendingEntry( |
| 123 const GURL& url, | 124 const GURL& url, |
| 124 content::NavigationController::ReloadType reload_type) override; | 125 content::ReloadType reload_type) override; |
| 125 | 126 |
| 126 // content::WebContentsObserver: | 127 // content::WebContentsObserver: |
| 127 void NavigationStopped() override; | 128 void NavigationStopped() override; |
| 128 | 129 |
| 129 // Deletes the SSLErrorHandler. This method is called when the page | 130 // Deletes the SSLErrorHandler. This method is called when the page |
| 130 // load stops or when there is a new navigation. | 131 // load stops or when there is a new navigation. |
| 131 void DeleteSSLErrorHandler(); | 132 void DeleteSSLErrorHandler(); |
| 132 | 133 |
| 133 content::WebContents* web_contents_; | 134 content::WebContents* web_contents_; |
| 134 const int cert_error_; | 135 const int cert_error_; |
| 135 const net::SSLInfo ssl_info_; | 136 const net::SSLInfo ssl_info_; |
| 136 const GURL request_url_; | 137 const GURL request_url_; |
| 137 const int options_mask_; | 138 const int options_mask_; |
| 138 base::Callback<void(content::CertificateRequestResultType)> callback_; | 139 base::Callback<void(content::CertificateRequestResultType)> callback_; |
| 139 Profile* const profile_; | 140 Profile* const profile_; |
| 140 | 141 |
| 141 content::NotificationRegistrar registrar_; | 142 content::NotificationRegistrar registrar_; |
| 142 base::OneShotTimer timer_; | 143 base::OneShotTimer timer_; |
| 143 | 144 |
| 144 std::unique_ptr<CommonNameMismatchHandler> common_name_mismatch_handler_; | 145 std::unique_ptr<CommonNameMismatchHandler> common_name_mismatch_handler_; |
| 145 | 146 |
| 146 std::unique_ptr<SSLCertReporter> ssl_cert_reporter_; | 147 std::unique_ptr<SSLCertReporter> ssl_cert_reporter_; |
| 147 | 148 |
| 148 DISALLOW_COPY_AND_ASSIGN(SSLErrorHandler); | 149 DISALLOW_COPY_AND_ASSIGN(SSLErrorHandler); |
| 149 }; | 150 }; |
| 150 | 151 |
| 151 #endif // CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ | 152 #endif // CHROME_BROWSER_SSL_SSL_ERROR_HANDLER_H_ |
| OLD | NEW |