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

Unified Diff: chrome/browser/interstitials/security_interstitial_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: add report-sending callback for browser tests Created 5 years, 10 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/interstitials/security_interstitial_page.h
diff --git a/chrome/browser/interstitials/security_interstitial_page.h b/chrome/browser/interstitials/security_interstitial_page.h
index 98e8e197eeb6f766f42631fe9c890f1764e0ca36..ee33f9e8e524ba368a6e57ee1ffd5a84b812b31c 100644
--- a/chrome/browser/interstitials/security_interstitial_page.h
+++ b/chrome/browser/interstitials/security_interstitial_page.h
@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_
#define CHROME_BROWSER_INTERSTITIALS_SECURITY_INTERSTITIAL_PAGE_H_
+#include "base/callback.h"
#include "base/strings/string16.h"
#include "content/public/browser/interstitial_page_delegate.h"
#include "url/gurl.h"
@@ -18,6 +19,14 @@ class InterstitialPage;
class WebContents;
}
+namespace interstitials {
+// Constants used to communicate with the JavaScript.
+extern const char kBoxChecked[];
+extern const char kDisplayCheckBox[];
+extern const char kOptInLink[];
+extern const char kPrivacyLinkHtml[];
+}
+
class SecurityInterstitialPage : public content::InterstitialPageDelegate {
public:
SecurityInterstitialPage(content::WebContents* web_contents,
@@ -33,6 +42,10 @@ class SecurityInterstitialPage : public content::InterstitialPageDelegate {
// Prevents creating the actual interstitial view for testing.
void DontCreateViewForTesting();
+ // Allows tests to be notified when an invalid cert chain report has
+ // been sent (or not sent).
+ void SetCertificateReportCallbackForTesting(base::Callback<void()>& callback);
mattm 2015/03/04 02:58:41 Shouldn't this (and the member) be on SSLBlockingP
estark 2015/03/12 22:22:21 I put them here because in a follow-up CL I'm goin
+
protected:
// Returns true if the interstitial should create a new navigation entry.
virtual bool ShouldCreateNewNavigation() const = 0;
@@ -51,6 +64,24 @@ class SecurityInterstitialPage : public content::InterstitialPageDelegate {
content::WebContents* web_contents() const;
GURL request_url() const;
+ // Record the user's preference for reporting information about
+ // malware and SSL errors.
+ void SetReportingPreference(bool report);
+
+ // Fills the passed dictionary with the values to be passed to the template
+ // when creating the HTML.
+ virtual void PopulateExtendedReportingOption(
+ base::DictionaryValue* load_time_data) = 0;
+
+ // Returns the boolean value of the given |pref| from the PrefService of the
+ // Profile associated with |web_contents_|.
+ bool IsPrefEnabled(const char* pref);
+
+ // 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::Callback<void()> certificate_report_callback_for_testing_;
Bernhard Bauer 2015/03/03 21:38:06 This is typedef'd as base::Closure.
estark 2015/03/12 22:22:21 Done.
+
private:
content::WebContents* web_contents_;
const GURL request_url_;

Powered by Google App Engine
This is Rietveld 408576698