Chromium Code Reviews| Index: chrome/browser/safe_browsing/safe_browsing_blocking_page.cc |
| diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc |
| index 67f2cc4dd0b3e7f6a96a07e1f5f7ca75a267bf5f..d012f396e1c0ff2dd81f1fe0fe2c3765640b6c0c 100644 |
| --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc |
| +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc |
| @@ -68,10 +68,6 @@ const char kLearnMoreMalwareUrlV2[] = |
| const char kLearnMorePhishingUrlV2[] = |
| "https://www.google.com/transparencyreport/safebrowsing/"; |
| -const char kPrivacyLinkHtml[] = |
| - "<a id=\"privacy-link\" href=\"\" onclick=\"sendCommand('showPrivacy'); " |
| - "return false;\" onmousedown=\"return false;\">%s</a>"; |
| - |
| // After a malware interstitial where the user opted-in to the report |
| // but clicked "proceed anyway", we delay the call to |
| // MalwareDetails::FinishCollection() by this much time (in |
| @@ -88,10 +84,6 @@ const char kShowDiagnosticCommand[] = "showDiagnostic"; |
| const char kShowPrivacyCommand[] = "showPrivacy"; |
| const char kTakeMeBackCommand[] = "takeMeBack"; |
| -// Other constants used to communicate with the JavaScript. |
| -const char kBoxChecked[] = "boxchecked"; |
| -const char kDisplayCheckBox[] = "displaycheckbox"; |
| - |
| // Constants for the Experience Sampling instrumentation. |
| const char kEventNameMalware[] = "safebrowsing_interstitial_"; |
| const char kEventNameHarmful[] = "harmful_interstitial_"; |
| @@ -374,14 +366,6 @@ void SafeBrowsingBlockingPage::OverrideRendererPrefs( |
| prefs, profile, web_contents()); |
| } |
| -void SafeBrowsingBlockingPage::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); |
| -} |
| - |
| void SafeBrowsingBlockingPage::OnProceed() { |
| proceeded_ = true; |
| // Send the malware details, if we opted to. |
| @@ -475,12 +459,6 @@ void SafeBrowsingBlockingPage::FinishMalwareDetails(int64 delay_ms) { |
| } |
| } |
| -bool SafeBrowsingBlockingPage::IsPrefEnabled(const char* pref) { |
| - Profile* profile = |
| - Profile::FromBrowserContext(web_contents()->GetBrowserContext()); |
| - return profile->GetPrefs()->GetBoolean(pref); |
| -} |
| - |
| // static |
| void SafeBrowsingBlockingPage::NotifySafeBrowsingUIManager( |
| SafeBrowsingUIManager* ui_manager, |
| @@ -622,20 +600,19 @@ void SafeBrowsingBlockingPage::PopulateExtendedReportingOption( |
| base::DictionaryValue* load_time_data) { |
| // Only show checkbox if !(HTTPS || incognito-mode). |
| const bool show = CanShowMalwareDetailsOption(); |
| - load_time_data->SetBoolean(kDisplayCheckBox, show); |
| + load_time_data->SetBoolean(interstitials::kDisplayCheckBox, show); |
| if (!show) |
| return; |
| const std::string privacy_link = base::StringPrintf( |
| - kPrivacyLinkHtml, |
| - l10n_util::GetStringUTF8( |
| - IDS_SAFE_BROWSING_PRIVACY_POLICY_PAGE).c_str()); |
| + interstitials::kPrivacyLinkHtml, |
| + l10n_util::GetStringUTF8(IDS_SAFE_BROWSING_PRIVACY_POLICY_PAGE).c_str()); |
| load_time_data->SetString( |
| "optInLink", |
|
Bernhard Bauer
2015/03/03 09:45:59
If you have constants for the other keys, you migh
estark
2015/03/03 15:36:24
Done.
|
| l10n_util::GetStringFUTF16(IDS_SAFE_BROWSING_MALWARE_REPORTING_AGREE, |
| base::UTF8ToUTF16(privacy_link))); |
| load_time_data->SetBoolean( |
| - kBoxChecked, |
| + interstitials::kBoxChecked, |
| IsPrefEnabled(prefs::kSafeBrowsingExtendedReportingEnabled)); |
| } |