| 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 8a72d874ac4729d6840b3fb00d87724872b8447e..de77fb5c5e33bae00d0e01e7b2bed3894dca995d 100644
|
| --- a/chrome/browser/interstitials/security_interstitial_page.cc
|
| +++ b/chrome/browser/interstitials/security_interstitial_page.cc
|
| @@ -5,9 +5,13 @@
|
| #include "chrome/browser/interstitials/security_interstitial_page.h"
|
|
|
| #include "base/i18n/rtl.h"
|
| +#include "base/metrics/histogram.h"
|
| +#include "base/prefs/pref_service.h"
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "base/values.h"
|
| #include "chrome/browser/browser_process.h"
|
| +#include "chrome/browser/profiles/profile.h"
|
| +#include "chrome/common/pref_names.h"
|
| #include "chrome/grit/browser_resources.h"
|
| #include "content/public/browser/interstitial_page.h"
|
| #include "content/public/browser/web_contents.h"
|
| @@ -72,3 +76,26 @@ std::string SecurityInterstitialPage::GetHTMLContents() {
|
| webui::AppendWebUiCssTextDefaults(&html);
|
| return webui::GetI18nTemplateHtml(html, &load_time_data);
|
| }
|
| +
|
| +SecurityInterstitialPageWithExtendedReporting::
|
| + SecurityInterstitialPageWithExtendedReporting(
|
| + content::WebContents* web_contents,
|
| + const GURL& url)
|
| + : SecurityInterstitialPage(web_contents, url) {
|
| +}
|
| +
|
| +void SecurityInterstitialPageWithExtendedReporting::SetReportingPreference(
|
| + bool report) {
|
| + Profile* profile =
|
| + Profile::FromBrowserContext(web_contents()->GetBrowserContext());
|
| + PrefService* pref = profile->GetPrefs();
|
| + pref->SetBoolean(prefs::kSafeBrowsingExtendedReportingEnabled, report);
|
| + UMA_HISTOGRAM_BOOLEAN("SB2.SetExtendedReportingEnabled", report);
|
| +}
|
| +
|
| +bool SecurityInterstitialPageWithExtendedReporting::IsPrefEnabled(
|
| + const char* pref) {
|
| + Profile* profile =
|
| + Profile::FromBrowserContext(web_contents()->GetBrowserContext());
|
| + return profile->GetPrefs()->GetBoolean(pref);
|
| +}
|
|
|