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

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

Issue 1982723002: Use FileTypePolicies for download danger classifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@use_policies
Patch Set: Fix bad rebase Created 4 years, 7 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/chrome_download_manager_delegate.cc
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
index 4caf2543e9599ca928ac1e3f0cae54740b5e7d75..4819efc41ff4c4aad3f8e04a819c1181bbabcbcb 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -73,6 +73,7 @@
using content::BrowserThread;
using content::DownloadItem;
using content::DownloadManager;
+using safe_browsing::DownloadFileType;
using safe_browsing::DownloadProtectionService;
namespace {
@@ -325,7 +326,7 @@ bool ChromeDownloadManagerDelegate::IsDownloadReadyForCompletion(
// we need to restore the danger state.
content::DownloadDangerType danger_type = item->GetDangerType();
if (DownloadItemModel(item).GetDangerLevel() !=
- download_util::NOT_DANGEROUS &&
+ DownloadFileType::NOT_DANGEROUS &&
(danger_type == content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS ||
danger_type ==
content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT)) {
@@ -668,7 +669,7 @@ void ChromeDownloadManagerDelegate::CheckClientDownloadDone(
case DownloadProtectionService::UNKNOWN:
// The check failed or was inconclusive.
if (DownloadItemModel(item).GetDangerLevel() !=
- download_util::NOT_DANGEROUS)
+ DownloadFileType::NOT_DANGEROUS)
danger_type = content::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE;
break;
case DownloadProtectionService::SAFE:
@@ -676,7 +677,7 @@ void ChromeDownloadManagerDelegate::CheckClientDownloadDone(
// to DANGEROUS_FILE so that the user be required to manually vet
// whether the download is intended or not.
if (DownloadItemModel(item).GetDangerLevel() ==
- download_util::DANGEROUS)
+ DownloadFileType::DANGEROUS)
danger_type = content::DOWNLOAD_DANGER_TYPE_DANGEROUS_FILE;
break;
case DownloadProtectionService::DANGEROUS:

Powered by Google App Engine
This is Rietveld 408576698