Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3590)

Unified Diff: chrome/browser/ssl/ssl_blocking_page.h

Issue 935663004: Add checkbox for reporting invalid TLS/SSL cert chains (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: set callback to DoNothing close to where it's used Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..2278c26d78b3d82aa4aa8b6b5f761508f14cbe2d 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,
felt 2015/03/13 19:18:11 You also need to rebase/update this, now that comm
estark 2015/03/16 23:40:53 Done.
};
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>&
+ certificate_error_reporter,
Ryan Sleevi 2015/03/14 03:09:42 Should you pass a reporter? Should you pass a cal
+ const base::Callback<void(bool)>& callback);
// InterstitialPageDelegate method:
InterstitialPageDelegate::TypeID GetTypeForTesting() const override;
@@ -79,6 +91,10 @@ class SSLBlockingPage : public SecurityInterstitialPage {
// Returns true if |options_mask| refers to an overridable SSL error.
static bool IsOptionsOverridable(int options_mask);
+ void SetCertificateErrorReporterForTesting(
+ const scoped_refptr<chrome_browser_net::CertificateErrorReporter>&
+ certificate_error_reporter);
+
protected:
// InterstitialPageDelegate implementation.
void CommandReceived(const std::string& command) override;
@@ -92,6 +108,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 +119,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 +147,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,

Powered by Google App Engine
This is Rietveld 408576698