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

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

Issue 1462353002: Create security_interstitials::ControllerClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nits for estark Created 5 years, 1 month 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 0cc658ea333a733bd815a88a075de05fd38bace6..d476177bc847bb6f61249b6a6d5f84b03f37c944 100644
--- a/chrome/browser/interstitials/security_interstitial_page.cc
+++ b/chrome/browser/interstitials/security_interstitial_page.cc
@@ -79,46 +79,12 @@ void SecurityInterstitialPage::Show() {
interstitial_page_->Show();
}
-void SecurityInterstitialPage::SetReportingPreference(bool report) {
- Profile* profile =
- Profile::FromBrowserContext(web_contents()->GetBrowserContext());
- PrefService* pref = profile->GetPrefs();
- pref->SetBoolean(prefs::kSafeBrowsingExtendedReportingEnabled, report);
- metrics_helper()->RecordUserInteraction(
- report ? security_interstitials::MetricsHelper::
- SET_EXTENDED_REPORTING_ENABLED
- : security_interstitials::MetricsHelper::
- SET_EXTENDED_REPORTING_DISABLED);
-}
-
bool SecurityInterstitialPage::IsPrefEnabled(const char* pref) {
Profile* profile =
Profile::FromBrowserContext(web_contents()->GetBrowserContext());
return profile->GetPrefs()->GetBoolean(pref);
}
-void SecurityInterstitialPage::OpenExtendedReportingPrivacyPolicy() {
- metrics_helper()->RecordUserInteraction(
- security_interstitials::MetricsHelper::SHOW_PRIVACY_POLICY);
- GURL privacy_url(
- l10n_util::GetStringUTF8(IDS_SAFE_BROWSING_PRIVACY_POLICY_URL));
- privacy_url = google_util::AppendGoogleLocaleParam(
- privacy_url, g_browser_process->GetApplicationLocale());
- OpenURLParams params(privacy_url, Referrer(), CURRENT_TAB,
- ui::PAGE_TRANSITION_LINK, false);
- web_contents()->OpenURL(params);
-}
-
-security_interstitials::MetricsHelper*
-SecurityInterstitialPage::metrics_helper() const {
- return metrics_helper_.get();
-}
-
-void SecurityInterstitialPage::set_metrics_helper(
- scoped_ptr<security_interstitials::MetricsHelper> metrics_helper) {
- metrics_helper_ = metrics_helper.Pass();
-}
-
base::string16 SecurityInterstitialPage::GetFormattedHostName() const {
std::string languages;
Profile* profile =
@@ -143,3 +109,23 @@ std::string SecurityInterstitialPage::GetHTMLContents() {
webui::AppendWebUiCssTextDefaults(&html);
return webui::GetI18nTemplateHtml(html, &load_time_data);
}
+
+void SecurityInterstitialPage::OpenUrlInCurrentTab(const GURL& url) {
+ OpenURLParams params(url, Referrer(), CURRENT_TAB, ui::PAGE_TRANSITION_LINK,
+ false);
+ web_contents()->OpenURL(params);
+}
+
+const std::string& SecurityInterstitialPage::GetApplicationLocale() {
+ return g_browser_process->GetApplicationLocale();
+}
+
+PrefService* SecurityInterstitialPage::GetPrefService() {
+ Profile* profile =
+ Profile::FromBrowserContext(web_contents()->GetBrowserContext());
+ return profile->GetPrefs();
+}
+
+const std::string SecurityInterstitialPage::GetExtendedReportingPrefName() {
+ return prefs::kSafeBrowsingExtendedReportingEnabled;
+}

Powered by Google App Engine
This is Rietveld 408576698