Chromium Code Reviews| Index: chrome/browser/ssl/ssl_blocking_page.h |
| diff --git a/chrome/browser/ssl/ssl_blocking_page.h b/chrome/browser/ssl/ssl_blocking_page.h |
| index 93635732cdb236f76f99a5fd53a9825c31ec0ff6..1ed572262708e290de7582dc86161d4aa0812bdd 100644 |
| --- a/chrome/browser/ssl/ssl_blocking_page.h |
| +++ b/chrome/browser/ssl/ssl_blocking_page.h |
| @@ -9,6 +9,7 @@ |
| #include <vector> |
| #include "base/callback.h" |
| +#include "base/memory/ref_counted.h" |
| #include "base/strings/string16.h" |
| #include "base/task/cancelable_task_tracker.h" |
| #include "base/time/time.h" |
| @@ -17,6 +18,10 @@ |
| #include "net/ssl/ssl_info.h" |
| #include "url/gurl.h" |
| +namespace chrome_browser_net { |
| +class CertificateErrorReporter; |
| +} |
| + |
| #if defined(ENABLE_EXTENSIONS) |
| namespace extensions { |
| class ExperienceSamplingEvent; |
| @@ -30,16 +35,20 @@ class SSLErrorClassification; |
| // It deletes itself when the interstitial page is closed. |
| class SSLBlockingPage : public SecurityInterstitialPage { |
| public: |
| - // These represent the commands sent from the interstitial JavaScript. They |
| - // are defined in chrome/browser/resources/ssl/ssl_errors_common.js. |
| - // DO NOT reorder or change these without also changing the JavaScript! |
| + // These represent the commands sent from the interstitial |
| + // JavaScript. They are defined in |
| + // chrome/browser/resources/security_warnings/ssl_errors_common.js. |
| + // DO NOT reorder or change these without also changing the |
| + // JavaScript! |
| enum SSLBlockingPageCommands { |
| CMD_DONT_PROCEED = 0, |
| CMD_PROCEED = 1, |
| CMD_MORE = 2, |
| CMD_RELOAD = 3, |
| CMD_HELP = 4, |
| - CMD_CLOCK = 5 |
| + CMD_CLOCK = 5, |
| + CMD_DO_REPORT = 6, |
| + CMD_DONT_REPORT = 7, |
| }; |
| enum SSLBlockingPageOptionsMask { |
| @@ -65,13 +74,16 @@ class SSLBlockingPage : public SecurityInterstitialPage { |
| // is responsible for cleaning up the blocking page, otherwise the |
| // interstitial takes ownership when shown. |options_mask| must be a bitwise |
| // mask of SSLBlockingPageOptionsMask values. |
| - SSLBlockingPage(content::WebContents* web_contents, |
| - int cert_error, |
| - const net::SSLInfo& ssl_info, |
| - const GURL& request_url, |
| - int options_mask, |
| - const base::Time& time_triggered, |
| - const base::Callback<void(bool)>& callback); |
| + SSLBlockingPage( |
| + content::WebContents* web_contents, |
| + int cert_error, |
| + const net::SSLInfo& ssl_info, |
| + const GURL& request_url, |
| + int options_mask, |
| + const base::Time& time_triggered, |
| + const scoped_refptr<chrome_browser_net::CertificateErrorReporter> |
|
Bernhard Bauer
2015/03/13 13:48:47
Should be const-ref.
estark
2015/03/13 16:21:17
Done.
|
| + certificate_error_reporter, |
| + const base::Callback<void(bool)>& callback); |
| // InterstitialPageDelegate method: |
| InterstitialPageDelegate::TypeID GetTypeForTesting() const override; |
| @@ -79,6 +91,9 @@ class SSLBlockingPage : public SecurityInterstitialPage { |
| // Returns true if |options_mask| refers to an overridable SSL error. |
| static bool IsOptionsOverridable(int options_mask); |
| + void SetCertificateErrorReporterForTesting(scoped_refptr< |
|
Bernhard Bauer
2015/03/13 13:48:48
Const-ref
estark
2015/03/13 16:21:17
Done.
|
| + chrome_browser_net::CertificateErrorReporter> certificate_error_reporter); |
| + |
| protected: |
| // InterstitialPageDelegate implementation. |
| void CommandReceived(const std::string& command) override; |
| @@ -92,6 +107,10 @@ class SSLBlockingPage : public SecurityInterstitialPage { |
| void PopulateInterstitialStrings( |
| base::DictionaryValue* load_time_data) override; |
| + // SecurityInterstitialPage implementation: |
| + void PopulateExtendedReportingOption( |
| + base::DictionaryValue* load_time_data) override; |
| + |
| private: |
| void NotifyDenyCertificate(); |
| void NotifyAllowCertificate(); |
| @@ -99,6 +118,10 @@ class SSLBlockingPage : public SecurityInterstitialPage { |
| std::string GetUmaHistogramPrefix() const; |
| std::string GetSamplingEventName() const; |
| + // Send a report about an invalid certificate to the server. Takes |
| + // care of calling certificate_report_callback_for_testing_. |
| + void FinishCertCollection(); |
| + |
| base::Callback<void(bool)> callback_; |
| const int cert_error_; |
| @@ -123,6 +146,9 @@ class SSLBlockingPage : public SecurityInterstitialPage { |
| // calculates all times relative to this. |
| const base::Time time_triggered_; |
| + scoped_refptr<chrome_browser_net::CertificateErrorReporter> |
| + certificate_error_reporter_; |
| + |
| // Which type of interstitial this is. |
| enum SSLInterstitialReason { |
| SSL_REASON_SSL, |