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

Unified Diff: chrome/browser/interstitials/security_interstitial_page.cc

Issue 2303413002: Simplify security_interstitials::ControllerClient and other related classes (Closed)
Patch Set: Jialiu comments Created 4 years, 3 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.cc
diff --git a/chrome/browser/interstitials/security_interstitial_page.cc b/chrome/browser/interstitials/security_interstitial_page.cc
index 0d1894761adebf66a311db830e8cc6566b944af8..5ba1e03956f5bfe1cb6f7c500b3c0b885f25db0c 100644
--- a/chrome/browser/interstitials/security_interstitial_page.cc
+++ b/chrome/browser/interstitials/security_interstitial_page.cc
@@ -27,12 +27,14 @@
SecurityInterstitialPage::SecurityInterstitialPage(
content::WebContents* web_contents,
- const GURL& request_url)
+ const GURL& request_url,
+ std::unique_ptr<security_interstitials::MetricsHelper> metrics_helper)
: web_contents_(web_contents),
request_url_(request_url),
interstitial_page_(NULL),
create_view_(true),
- controller_(new ChromeControllerClient(web_contents)) {
+ controller_(
+ new ChromeControllerClient(web_contents, std::move(metrics_helper))) {
// Creating interstitial_page_ without showing it leaks memory, so don't
// create it here.
}
@@ -74,6 +76,15 @@ bool SecurityInterstitialPage::IsPrefEnabled(const char* pref) {
return profile->GetPrefs()->GetBoolean(pref);
}
+ChromeControllerClient* SecurityInterstitialPage::controller() {
+ return controller_.get();
+}
+
+security_interstitials::MetricsHelper*
+SecurityInterstitialPage::metrics_helper() {
+ return controller_->metrics_helper();
+}
+
base::string16 SecurityInterstitialPage::GetFormattedHostName() const {
return security_interstitials::common_string_util::GetFormattedHostName(
request_url_);
@@ -90,17 +101,3 @@ std::string SecurityInterstitialPage::GetHTMLContents() {
webui::AppendWebUiCssTextDefaults(&html);
return webui::GetI18nTemplateHtml(html, &load_time_data);
}
-
-security_interstitials::MetricsHelper*
-SecurityInterstitialPage::metrics_helper() {
- return controller_->metrics_helper();
-}
-
-void SecurityInterstitialPage::set_metrics_helper(
- std::unique_ptr<security_interstitials::MetricsHelper> metrics_helper) {
- controller_->set_metrics_helper(std::move(metrics_helper));
-}
-
-ChromeControllerClient* SecurityInterstitialPage::controller() {
- return controller_.get();
-}
« no previous file with comments | « chrome/browser/interstitials/security_interstitial_page.h ('k') | chrome/browser/safe_browsing/safe_browsing_blocking_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698