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 4b9b7f184cbf776ee0ef5ea25089b162a256d90f..1ce1ad8239087b91dea30737755672f3e16a1dd7 100644 |
--- a/chrome/browser/ssl/ssl_blocking_page.h |
+++ b/chrome/browser/ssl/ssl_blocking_page.h |
@@ -12,7 +12,6 @@ |
#include "base/strings/string16.h" |
#include "base/task/cancelable_task_tracker.h" |
#include "base/time/time.h" |
-#include "chrome/browser/interstitials/security_interstitial_metrics_helper.h" |
#include "chrome/browser/interstitials/security_interstitial_page.h" |
#include "net/ssl/ssl_info.h" |
#include "url/gurl.h" |
@@ -23,6 +22,7 @@ class ExperienceSamplingEvent; |
} |
#endif |
+class SafeBrowsingUIManager; |
class SSLErrorClassification; |
// This class is responsible for showing/hiding the interstitial page that is |
@@ -59,6 +59,7 @@ class SSLBlockingPage : public SecurityInterstitialPage { |
const GURL& request_url, |
int options_mask, |
const base::Time& time_triggered, |
+ SafeBrowsingUIManager* safe_browsing_ui_manager, |
const base::Callback<void(bool)>& callback); |
// InterstitialPageDelegate method: |
@@ -67,6 +68,10 @@ class SSLBlockingPage : public SecurityInterstitialPage { |
// Returns true if |options_mask| refers to an overridable SSL error. |
static bool IsOptionsOverridable(int options_mask); |
+ // Allows tests to be notified when an invalid cert chain report has |
+ // been sent (or not sent). |
+ void SetCertificateReportCallbackForTesting(const base::Closure& callback); |
+ |
protected: |
// InterstitialPageDelegate implementation. |
void CommandReceived(const std::string& command) override; |
@@ -80,6 +85,8 @@ class SSLBlockingPage : public SecurityInterstitialPage { |
void PopulateInterstitialStrings( |
base::DictionaryValue* load_time_data) override; |
+ void PopulateExtendedReportingOption(base::DictionaryValue* load_time_data); |
+ |
private: |
void NotifyDenyCertificate(); |
void NotifyAllowCertificate(); |
@@ -87,6 +94,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_; |
@@ -106,11 +117,20 @@ class SSLBlockingPage : public SecurityInterstitialPage { |
// expired? |
const bool expired_but_previously_allowed_; |
scoped_ptr<SSLErrorClassification> ssl_error_classification_; |
- scoped_ptr<SecurityInterstitialMetricsHelper> metrics_helper_; |
+ |
// The time at which the interstitial was triggered. The interstitial |
// calculates all times relative to this. |
const base::Time time_triggered_; |
+ // For reporting invalid SSL certificates as part of Safe Browsing |
+ // Extended Reporting. |
+ SafeBrowsingUIManager* safe_browsing_ui_manager_; |
+ |
+ // This callback is run when an extended reporting certificate chain |
+ // report has been sent, or when it is decided that it should not be |
+ // sent (for example, when in incognito mode). |
+ base::Closure certificate_report_callback_for_testing_; |
+ |
// Which type of interstitial this is. |
enum SSLInterstitialReason { |
SSL_REASON_SSL, |