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

Unified Diff: chrome/browser/download/download_item_model.cc

Issue 15881012: Implement safebrowsing download feedback service, enabled for dev & canary only. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 6 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/download/download_item_model.cc
diff --git a/chrome/browser/download/download_item_model.cc b/chrome/browser/download/download_item_model.cc
index 347a554ec8c5425b4b472231464f8222af43c6b8..8561c6b8bac17aade3871439deecb420aec27fff 100644
--- a/chrome/browser/download/download_item_model.cc
+++ b/chrome/browser/download/download_item_model.cc
@@ -12,6 +12,7 @@
#include "base/supports_user_data.h"
#include "base/time.h"
#include "chrome/browser/download/download_crx_util.h"
+#include "chrome/browser/safe_browsing/download_feedback_service.h"
#include "chrome/common/time_format.h"
#include "content/public/browser/download_danger_type.h"
#include "content/public/browser/download_interrupt_reasons.h"
@@ -393,6 +394,13 @@ bool DownloadItemModel::IsMalicious() const {
return false;
}
+bool DownloadItemModel::ShouldAllowDownloadFeedback() const {
+ if (!IsDangerous())
+ return false;
+ return safe_browsing::DownloadFeedbackService::IsEnabledForDownload(
+ *download_);
+}
+
bool DownloadItemModel::ShouldRemoveFromShelfWhenComplete() const {
// If the download was already opened automatically, it should be removed.
if (download_->GetAutoOpened())

Powered by Google App Engine
This is Rietveld 408576698