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 31e195d5c62b00778515c53bb58e256d9b3332bb..f1257871dd3ef64f66fc0f0cdde719f0fb54bfe9 100644 |
| --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc |
| +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page.cc |
| @@ -189,7 +189,6 @@ SafeBrowsingBlockingPage::SafeBrowsingBlockingPage( |
| url_(unsafe_resources[0].url), |
| interstitial_page_(NULL), |
| has_expanded_see_more_section_(false), |
| - reporting_checkbox_checked_(false), |
| create_view_(true), |
| num_visits_(-1) { |
| bool malware = false; |
| @@ -446,31 +445,11 @@ void SafeBrowsingBlockingPage::SetReportingPreference(bool report) { |
| PrefService* pref = profile->GetPrefs(); |
| pref->SetBoolean(prefs::kSafeBrowsingExtendedReportingEnabled, report); |
| UMA_HISTOGRAM_BOOLEAN("SB2.SetExtendedReportingEnabled", report); |
| - reporting_checkbox_checked_ = report; |
| - pref->ClearPref(prefs::kSafeBrowsingReportingEnabled); |
| - pref->ClearPref(prefs::kSafeBrowsingDownloadFeedbackEnabled); |
| -} |
| - |
| -// If the reporting checkbox was left checked on close, the new pref |
| -// kSafeBrowsingExtendedReportingEnabled should be updated. |
| -// TODO(felt): Remove this in M-39. crbug.com/384668 |
| -void SafeBrowsingBlockingPage::UpdateReportingPref() { |
| - if (!reporting_checkbox_checked_) |
| - return; |
| - if (IsPrefEnabled(prefs::kSafeBrowsingExtendedReportingEnabled)) |
| - return; |
| - Profile* profile = Profile::FromBrowserContext( |
| - web_contents_->GetBrowserContext()); |
| - if (profile->GetPrefs()->HasPrefPath( |
| - prefs::kSafeBrowsingExtendedReportingEnabled)) |
| - return; |
| - SetReportingPreference(true); |
| } |
| void SafeBrowsingBlockingPage::OnProceed() { |
| proceeded_ = true; |
| RecordUserAction(PROCEED); |
| - UpdateReportingPref(); |
| // Send the malware details, if we opted to. |
| FinishMalwareDetails(malware_details_proceed_delay_ms_); |
| @@ -523,7 +502,6 @@ void SafeBrowsingBlockingPage::OnDontProceed() { |
| return; |
| RecordUserAction(DONT_PROCEED); |
| - UpdateReportingPref(); |
| // Send the malware details, if we opted to. |
| FinishMalwareDetails(0); // No delay |
| @@ -937,14 +915,11 @@ void SafeBrowsingBlockingPage::PopulateMalwareLoadTimeData( |
| web_contents_->GetBrowserContext()); |
| if (profile->GetPrefs()->HasPrefPath( |
| prefs::kSafeBrowsingExtendedReportingEnabled)) { |
|
mattm
2014/08/28 20:57:01
This HasPrefPath shouldn't be needed anymore
felt
2014/08/28 21:43:30
you're right. re-tested with both clean and dirty
|
| - reporting_checkbox_checked_ = |
| - IsPrefEnabled(prefs::kSafeBrowsingExtendedReportingEnabled); |
| - } else if (IsPrefEnabled(prefs::kSafeBrowsingReportingEnabled) || |
| - IsPrefEnabled(prefs::kSafeBrowsingDownloadFeedbackEnabled)) { |
| - reporting_checkbox_checked_ = true; |
| + load_time_data->SetBoolean( |
| + kBoxChecked, |
| + IsPrefEnabled(prefs::kSafeBrowsingExtendedReportingEnabled)); |
| } |
| - load_time_data->SetBoolean( |
| - kBoxChecked, reporting_checkbox_checked_); |
| + |
| } |
| } |