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

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

Issue 9639003: Handle uncommon download verdict for safebrowsing download protection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 9 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 | « no previous file | chrome/browser/safe_browsing/download_protection_service.h » ('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 4211ffe2648da72b567756950aa0f3694b86ec6a..562601a2841dd1856abb6cea48dbbf733d4a3f00 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -329,7 +329,7 @@ void ChromeDownloadManagerDelegate::CheckDownloadUrlDone(
VLOG(2) << __FUNCTION__ << "() download = " << download->DebugString(false)
<< " verdict = " << result;
- if (result == DownloadProtectionService::DANGEROUS)
+ if (result != DownloadProtectionService::SAFE)
download->SetDangerType(content::DOWNLOAD_DANGER_TYPE_DANGEROUS_URL);
download_history_->CheckVisitedReferrerBefore(
@@ -349,9 +349,19 @@ void ChromeDownloadManagerDelegate::CheckClientDownloadDone(
<< " verdict = " << result;
// We only mark the content as being dangerous if the download's safety state
// has not been set to DANGEROUS yet. We don't want to show two warnings.
- if (result == DownloadProtectionService::DANGEROUS &&
- item->GetSafetyState() == DownloadItem::SAFE)
- item->SetDangerType(content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT);
+ if (item->GetSafetyState() == DownloadItem::SAFE) {
+ switch (result) {
+ case DownloadProtectionService::SAFE:
+ // Do nothing.
+ break;
+ case DownloadProtectionService::DANGEROUS:
+ item->SetDangerType(content::DOWNLOAD_DANGER_TYPE_DANGEROUS_CONTENT);
+ break;
+ case DownloadProtectionService::UNCOMMON:
+ item->SetDangerType(content::DOWNLOAD_DANGER_TYPE_UNCOMMON_CONTENT);
+ break;
+ }
+ }
SafeBrowsingState* state = static_cast<SafeBrowsingState*>(
item->GetExternalData(&safe_browsing_id));
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/download_protection_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698