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

Unified Diff: chrome/browser/safe_browsing/download_protection_service.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
Index: chrome/browser/safe_browsing/download_protection_service.cc
diff --git a/chrome/browser/safe_browsing/download_protection_service.cc b/chrome/browser/safe_browsing/download_protection_service.cc
index 2c5f5901c2a16f35211e953f68a0f5a351bfe2ab..62c12fa4936b3c0a6cfdd4111618eff9c09ac359 100644
--- a/chrome/browser/safe_browsing/download_protection_service.cc
+++ b/chrome/browser/safe_browsing/download_protection_service.cc
@@ -417,6 +417,10 @@ class DownloadProtectionService::CheckClientDownloadRequest
} else if (response.verdict() == ClientDownloadResponse::DANGEROUS_HOST) {
reason = REASON_DOWNLOAD_DANGEROUS_HOST;
result = DANGEROUS_HOST;
+ } else if (
+ response.verdict() == ClientDownloadResponse::POTENTIALLY_UNWANTED) {
+ reason = REASON_DOWNLOAD_POTENTIALLY_UNWANTED;
+ result = POTENTIALLY_UNWANTED;
} else {
LOG(DFATAL) << "Unknown download response verdict: "
<< response.verdict();
@@ -864,8 +868,12 @@ void DownloadProtectionService::RequestFinished(
void DownloadProtectionService::ShowDetailsForDownload(
const content::DownloadItem& item,
content::PageNavigator* navigator) {
+ GURL learn_more_url(chrome::kDownloadScanningLearnMoreURL);
+ if (item.GetDangerType() ==
+ content::DOWNLOAD_DANGER_TYPE_POTENTIALLY_UNWANTED)
+ learn_more_url = GURL(chrome::kDownloadPotentiallyUnwantedLearnMoreURL);
navigator->OpenURL(
- content::OpenURLParams(GURL(chrome::kDownloadScanningLearnMoreURL),
+ content::OpenURLParams(learn_more_url,
content::Referrer(),
NEW_FOREGROUND_TAB,
content::PAGE_TRANSITION_LINK,

Powered by Google App Engine
This is Rietveld 408576698