Commit bf1583d7 authored by Mustafa Emre Acer's avatar Mustafa Emre Acer Committed by Commit Bot

Move SetSSLCertReporterForTesting() to SSLBlockingPageBase

The method is duplicated by sublasses. Push it to the base class instead.
An upcoming CL will use this for CaptivePortalBlockingPage as well.

Change-Id: Id24993df5fa0f7a0371e01ee84bf4788a196aca6
Reviewed-on: https://chromium-review.googlesource.com/902805Reviewed-by: default avatarCarlos IL <carlosil@chromium.org>
Commit-Queue: Mustafa Emre Acer <meacer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#534519}
parent 5e45044e
......@@ -116,12 +116,6 @@ void BadClockBlockingPage::OverrideEntry(NavigationEntry* entry) {
entry->GetSSL() = content::SSLStatus(ssl_info_);
}
void BadClockBlockingPage::SetSSLCertReporterForTesting(
std::unique_ptr<SSLCertReporter> ssl_cert_reporter) {
cert_report_helper()->SetSSLCertReporterForTesting(
std::move(ssl_cert_reporter));
}
// This handles the commands sent from the interstitial JavaScript.
void BadClockBlockingPage::CommandReceived(const std::string& command) {
if (command == "\"pageLoadComplete\"") {
......
......@@ -50,9 +50,6 @@ class BadClockBlockingPage : public SSLBlockingPageBase {
// InterstitialPageDelegate method:
InterstitialPageDelegate::TypeID GetTypeForTesting() const override;
void SetSSLCertReporterForTesting(
std::unique_ptr<SSLCertReporter> ssl_cert_reporter);
protected:
// InterstitialPageDelegate implementation:
void CommandReceived(const std::string& command) override;
......
......@@ -117,12 +117,6 @@ void MITMSoftwareBlockingPage::OverrideEntry(NavigationEntry* entry) {
entry->GetSSL() = content::SSLStatus(ssl_info_);
}
void MITMSoftwareBlockingPage::SetSSLCertReporterForTesting(
std::unique_ptr<SSLCertReporter> ssl_cert_reporter) {
cert_report_helper()->SetSSLCertReporterForTesting(
std::move(ssl_cert_reporter));
}
// This handles the commands sent from the interstitial JavaScript.
void MITMSoftwareBlockingPage::CommandReceived(const std::string& command) {
if (command == "\"pageLoadComplete\"") {
......
......@@ -52,9 +52,6 @@ class MITMSoftwareBlockingPage : public SSLBlockingPageBase {
// InterstitialPageDelegate method:
InterstitialPageDelegate::TypeID GetTypeForTesting() const override;
void SetSSLCertReporterForTesting(
std::unique_ptr<SSLCertReporter> ssl_cert_reporter);
protected:
// InterstitialPageDelegate implementation:
void CommandReceived(const std::string& command) override;
......
......@@ -188,12 +188,6 @@ void SSLBlockingPage::OverrideEntry(NavigationEntry* entry) {
entry->GetSSL() = content::SSLStatus(ssl_info_);
}
void SSLBlockingPage::SetSSLCertReporterForTesting(
std::unique_ptr<SSLCertReporter> ssl_cert_reporter) {
cert_report_helper()->SetSSLCertReporterForTesting(
std::move(ssl_cert_reporter));
}
// This handles the commands sent from the interstitial JavaScript.
void SSLBlockingPage::CommandReceived(const std::string& command) {
if (command == "\"pageLoadComplete\"") {
......
......@@ -68,9 +68,6 @@ class SSLBlockingPage : public SSLBlockingPageBase {
// if SSL error overriding is allowed by policy.
static bool IsOverridable(int options_mask);
void SetSSLCertReporterForTesting(
std::unique_ptr<SSLCertReporter> ssl_cert_reporter);
protected:
friend class policy::PolicyTest_SSLErrorOverridingDisallowed_Test;
friend class SSLUITestBase;
......
......@@ -40,6 +40,12 @@ void SSLBlockingPageBase::OnInterstitialClosing() {
cert_report_helper_->FinishCertCollection();
}
void SSLBlockingPageBase::SetSSLCertReporterForTesting(
std::unique_ptr<SSLCertReporter> ssl_cert_reporter) {
cert_report_helper_->SetSSLCertReporterForTesting(
std::move(ssl_cert_reporter));
}
CertReportHelper* SSLBlockingPageBase::cert_report_helper() {
return cert_report_helper_.get();
}
......@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_BASE_H_
#define CHROME_BROWSER_SSL_SSL_BLOCKING_PAGE_BASE_H_
#include "chrome/browser/ssl/cert_report_helper.h"
#include "components/certificate_reporting/error_report.h"
#include "components/security_interstitials/content/security_interstitial_page.h"
......@@ -41,6 +42,9 @@ class SSLBlockingPageBase
// security_interstitials::SecurityInterstitialPage:
void OnInterstitialClosing() override;
void SetSSLCertReporterForTesting(
std::unique_ptr<SSLCertReporter> ssl_cert_reporter);
protected:
CertReportHelper* cert_report_helper();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment