| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_BLOCKING_PAGE_H_ | 5 #ifndef CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ |
| 6 #define CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ | 6 #define CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/callback.h" | 11 #include "base/callback.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
| 14 #include "base/task/cancelable_task_tracker.h" | 14 #include "base/task/cancelable_task_tracker.h" |
| 15 #include "base/time/time.h" | 15 #include "base/time/time.h" |
| 16 #include "chrome/browser/interstitials/security_interstitial_page.h" | 16 #include "chrome/browser/interstitials/security_interstitial_page.h" |
| 17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
| 18 #include "chrome/browser/ssl/ssl_cert_reporter.h" | 18 #include "chrome/browser/ssl/ssl_cert_reporter.h" |
| 19 #include "components/certificate_reporting/error_report.h" | 19 #include "components/certificate_reporting/error_report.h" |
| 20 #include "content/public/browser/certificate_request_result_type.h" |
| 20 #include "net/ssl/ssl_info.h" | 21 #include "net/ssl/ssl_info.h" |
| 21 #include "url/gurl.h" | 22 #include "url/gurl.h" |
| 22 | 23 |
| 23 #if defined(ENABLE_EXTENSIONS) | 24 #if defined(ENABLE_EXTENSIONS) |
| 24 namespace extensions { | 25 namespace extensions { |
| 25 class ExperienceSamplingEvent; | 26 class ExperienceSamplingEvent; |
| 26 } | 27 } |
| 27 #endif | 28 #endif |
| 28 | 29 |
| 29 namespace policy { | 30 namespace policy { |
| (...skipping 22 matching lines...) Expand all Loading... |
| 52 // is responsible for cleaning up the blocking page, otherwise the | 53 // is responsible for cleaning up the blocking page, otherwise the |
| 53 // interstitial takes ownership when shown. |options_mask| must be a bitwise | 54 // interstitial takes ownership when shown. |options_mask| must be a bitwise |
| 54 // mask of SSLErrorUI::SSLErrorOptionsMask values. | 55 // mask of SSLErrorUI::SSLErrorOptionsMask values. |
| 55 SSLBlockingPage(content::WebContents* web_contents, | 56 SSLBlockingPage(content::WebContents* web_contents, |
| 56 int cert_error, | 57 int cert_error, |
| 57 const net::SSLInfo& ssl_info, | 58 const net::SSLInfo& ssl_info, |
| 58 const GURL& request_url, | 59 const GURL& request_url, |
| 59 int options_mask, | 60 int options_mask, |
| 60 const base::Time& time_triggered, | 61 const base::Time& time_triggered, |
| 61 std::unique_ptr<SSLCertReporter> ssl_cert_reporter, | 62 std::unique_ptr<SSLCertReporter> ssl_cert_reporter, |
| 62 const base::Callback<void(bool)>& callback); | 63 const base::Callback< |
| 64 void(content::CertificateRequestResultType)>& callback); |
| 63 | 65 |
| 64 // InterstitialPageDelegate method: | 66 // InterstitialPageDelegate method: |
| 65 InterstitialPageDelegate::TypeID GetTypeForTesting() const override; | 67 InterstitialPageDelegate::TypeID GetTypeForTesting() const override; |
| 66 | 68 |
| 67 // Returns true if |options_mask| refers to a soft-overridable SSL error and | 69 // Returns true if |options_mask| refers to a soft-overridable SSL error and |
| 68 // if SSL error overriding is allowed by policy. | 70 // if SSL error overriding is allowed by policy. |
| 69 static bool IsOverridable(int options_mask, const Profile* const profile); | 71 static bool IsOverridable(int options_mask, const Profile* const profile); |
| 70 | 72 |
| 71 void SetSSLCertReporterForTesting( | 73 void SetSSLCertReporterForTesting( |
| 72 std::unique_ptr<SSLCertReporter> ssl_cert_reporter); | 74 std::unique_ptr<SSLCertReporter> ssl_cert_reporter); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 84 | 86 |
| 85 // SecurityInterstitialPage implementation: | 87 // SecurityInterstitialPage implementation: |
| 86 bool ShouldCreateNewNavigation() const override; | 88 bool ShouldCreateNewNavigation() const override; |
| 87 void PopulateInterstitialStrings( | 89 void PopulateInterstitialStrings( |
| 88 base::DictionaryValue* load_time_data) override; | 90 base::DictionaryValue* load_time_data) override; |
| 89 void AfterShow() override; | 91 void AfterShow() override; |
| 90 | 92 |
| 91 private: | 93 private: |
| 92 void NotifyDenyCertificate(); | 94 void NotifyDenyCertificate(); |
| 93 | 95 |
| 94 base::Callback<void(bool)> callback_; | 96 base::Callback<void(content::CertificateRequestResultType)> callback_; |
| 95 const net::SSLInfo ssl_info_; | 97 const net::SSLInfo ssl_info_; |
| 96 const bool overridable_; // The UI allows the user to override the error. | 98 const bool overridable_; // The UI allows the user to override the error. |
| 97 | 99 |
| 98 // The user previously allowed a bad certificate, but the decision has now | 100 // The user previously allowed a bad certificate, but the decision has now |
| 99 // expired. | 101 // expired. |
| 100 const bool expired_but_previously_allowed_; | 102 const bool expired_but_previously_allowed_; |
| 101 | 103 |
| 102 std::unique_ptr<ChromeControllerClient> controller_; | 104 std::unique_ptr<ChromeControllerClient> controller_; |
| 103 std::unique_ptr<security_interstitials::SSLErrorUI> ssl_error_ui_; | 105 std::unique_ptr<security_interstitials::SSLErrorUI> ssl_error_ui_; |
| 104 std::unique_ptr<CertReportHelper> cert_report_helper_; | 106 std::unique_ptr<CertReportHelper> cert_report_helper_; |
| 105 | 107 |
| 106 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); | 108 DISALLOW_COPY_AND_ASSIGN(SSLBlockingPage); |
| 107 }; | 109 }; |
| 108 | 110 |
| 109 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ | 111 #endif // CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_H_ |
| OLD | NEW |