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

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

Issue 19863005: Warn users about potentially unwanted downloads. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Add a "Learn more" URL for unwanted downloads. Created 7 years, 5 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
« no previous file with comments | « chrome/browser/automation/automation_provider.cc ('k') | chrome/browser/download/download_danger_prompt.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 733134927b430bbdffcbc1ff18167b8746db0fd7..2c2c77544f2a5693e5aefa05cb29f7f9271835a5 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -525,23 +525,28 @@ void ChromeDownloadManagerDelegate::CheckClientDownloadDone(
if (item->GetDangerType() == content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS ||
item->GetDangerType() ==
content::DOWNLOAD_DANGER_TYPE_MAYBE_DANGEROUS_CONTENT) {
+ content::DownloadDangerType danger_type =
+ content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS;
switch (result) {
case DownloadProtectionService::SAFE:
// Do nothing.
break;
case DownloadProtectionService::DANGEROUS:
- item->OnContentCheckCompleted(
- content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT);
+ danger_type = content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT;
break;
case DownloadProtectionService::UNCOMMON:
- item->OnContentCheckCompleted(
- content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT);
+ danger_type = content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT;
break;
case DownloadProtectionService::DANGEROUS_HOST:
- item->OnContentCheckCompleted(
- content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST);
+ danger_type = content::DOWNLOAD_DANGER_TYPE_DANGEROUS_HOST;
+ break;
+ case DownloadProtectionService::POTENTIALLY_UNWANTED:
+ danger_type = content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED;
break;
}
+
+ if (danger_type != content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS)
+ item->OnContentCheckCompleted(danger_type);
}
SafeBrowsingState* state = static_cast<SafeBrowsingState*>(
« no previous file with comments | « chrome/browser/automation/automation_provider.cc ('k') | chrome/browser/download/download_danger_prompt.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698