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

Unified Diff: chrome/browser/ui/views/download/download_item_view.cc

Issue 153353006: Opt out of download feedback from settings (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: First version for review Created 6 years, 10 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/ui/views/download/download_item_view.cc
diff --git a/chrome/browser/ui/views/download/download_item_view.cc b/chrome/browser/ui/views/download/download_item_view.cc
index 7a3d9714d3579f82928cb477f823f410e53a0554..23b2b081b9130732a88e0e410038034af1ae36f9 100644
--- a/chrome/browser/ui/views/download/download_item_view.cc
+++ b/chrome/browser/ui/views/download/download_item_view.cc
@@ -91,6 +91,7 @@ static const int kDisabledOnOpenDuration = 3000;
static const double kDownloadItemLuminanceMod = 0.8;
using content::DownloadItem;
+using safe_browsing::DownloadFeedbackService;
DownloadItemView::DownloadItemView(DownloadItem* download_item,
DownloadShelfView* parent)
@@ -557,12 +558,12 @@ void DownloadItemView::ButtonPressed(views::Button* sender,
UMA_HISTOGRAM_LONG_TIMES("clickjacking.discard_download", warning_duration);
if (model_.ShouldAllowDownloadFeedback() &&
!shelf_->browser()->profile()->IsOffTheRecord()) {
- DownloadFeedbackDialogView::DownloadReportingStatus pref_value =
- static_cast<DownloadFeedbackDialogView::DownloadReportingStatus>(
+ DownloadFeedbackService::DownloadReportingStatus pref_value =
+ static_cast<DownloadFeedbackService::DownloadReportingStatus>(
shelf_->browser()->profile()->GetPrefs()->GetInteger(
prefs::kSafeBrowsingDownloadReportingEnabled));
switch (pref_value) {
- case DownloadFeedbackDialogView::kDialogNotYetShown:
+ case DownloadFeedbackService::kDialogNotYetShown:
DownloadFeedbackDialogView::Show(
shelf_->get_parent()->GetNativeWindow(),
shelf_->browser()->profile(),
@@ -571,12 +572,12 @@ void DownloadItemView::ButtonPressed(views::Button* sender,
weak_ptr_factory_.GetWeakPtr()));
break;
- case DownloadFeedbackDialogView::kDownloadReportingEnabled:
- case DownloadFeedbackDialogView::kDownloadReportingDisabled:
+ case DownloadFeedbackService::kDownloadReportingEnabled:
+ case DownloadFeedbackService::kDownloadReportingDisabled:
PossiblySubmitDownloadToFeedbackService(pref_value);
break;
- case DownloadFeedbackDialogView::kMaxValue:
+ case DownloadFeedbackService::kMaxValue:
NOTREACHED();
}
return;
@@ -938,8 +939,8 @@ bool DownloadItemView::SubmitDownloadToFeedbackService() {
}
void DownloadItemView::PossiblySubmitDownloadToFeedbackService(
- DownloadFeedbackDialogView::DownloadReportingStatus status) {
- if (status != DownloadFeedbackDialogView::kDownloadReportingEnabled ||
+ DownloadFeedbackService::DownloadReportingStatus status) {
+ if (status != DownloadFeedbackService::kDownloadReportingEnabled ||
!SubmitDownloadToFeedbackService()) {
download()->Remove();
}
@@ -1156,10 +1157,8 @@ void DownloadItemView::ShowWarningDialog() {
content::DownloadDangerType danger_type = download()->GetDangerType();
RecordDangerousDownloadWarningShown(danger_type);
#if defined(FULL_SAFE_BROWSING)
- if (model_.ShouldAllowDownloadFeedback()) {
- safe_browsing::DownloadFeedbackService::RecordEligibleDownloadShown(
- danger_type);
- }
+ if (model_.ShouldAllowDownloadFeedback())
+ DownloadFeedbackService::RecordEligibleDownloadShown(danger_type);
#endif
mode_ = model_.MightBeMalicious() ? MALICIOUS_MODE : DANGEROUS_MODE;

Powered by Google App Engine
This is Rietveld 408576698