summaryrefslogtreecommitdiffstats
path: root/chrome/browser/safe_browsing/protocol_manager.cc
diff options
context:
space:
mode:
authorlzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-26 00:11:35 +0000
committerlzheng@chromium.org <lzheng@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-02-26 00:11:35 +0000
commit287b86bfa8405f38377eb4b6c33c28b8a926fb2a (patch)
treef6c1d0e24dcbcf10f0bccec3b5688c623c49137b /chrome/browser/safe_browsing/protocol_manager.cc
parent144259d6f653fe03ec889d24605e60a00e5a28a0 (diff)
downloadchromium_src-287b86bfa8405f38377eb4b6c33c28b8a926fb2a.zip
chromium_src-287b86bfa8405f38377eb4b6c33c28b8a926fb2a.tar.gz
chromium_src-287b86bfa8405f38377eb4b6c33c28b8a926fb2a.tar.bz2
Enable url check in download_manager, with a simple UI (it may need polish). The whole thing is still behind a flag.
The download_file_manager will start a url check with safebrowsing. It goes parallel with file creation operation. When url is checked to be dangerous, the UI dialog will show the dialog. TEST=download_manager_unittest BUG=60822 Review URL: http://codereview.chromium.org/6410050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@76123 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/safe_browsing/protocol_manager.cc')
-rw-r--r--chrome/browser/safe_browsing/protocol_manager.cc21
1 files changed, 17 insertions, 4 deletions
diff --git a/chrome/browser/safe_browsing/protocol_manager.cc b/chrome/browser/safe_browsing/protocol_manager.cc
index 5e61eca..77e0a8a 100644
--- a/chrome/browser/safe_browsing/protocol_manager.cc
+++ b/chrome/browser/safe_browsing/protocol_manager.cc
@@ -762,14 +762,27 @@ GURL SafeBrowsingProtocolManager::SafeBrowsingHitUrl(
const GURL& referrer_url, bool is_subresource,
SafeBrowsingService::UrlCheckResult threat_type) const {
DCHECK(threat_type == SafeBrowsingService::URL_MALWARE ||
- threat_type == SafeBrowsingService::URL_PHISHING);
+ threat_type == SafeBrowsingService::URL_PHISHING ||
+ threat_type == SafeBrowsingService::BINARY_MALWARE_URL);
// The malware and phishing hits go over HTTP.
std::string url = ComposeUrl(http_url_prefix_, "report", client_name_,
version_, additional_query_);
+ std::string threat_list = "none";
+ switch (threat_type) {
+ case SafeBrowsingService::URL_MALWARE:
+ threat_list = "malblhit";
+ break;
+ case SafeBrowsingService::URL_PHISHING:
+ threat_list = "phishblhit";
+ break;
+ case SafeBrowsingService::BINARY_MALWARE_URL:
+ threat_list = "binurlhit";
+ break;
+ default:
+ NOTREACHED();
+ }
return GURL(StringPrintf("%s&evts=%s&evtd=%s&evtr=%s&evhr=%s&evtb=%d",
- url.c_str(),
- (threat_type == SafeBrowsingService::URL_MALWARE) ?
- "malblhit" : "phishblhit",
+ url.c_str(), threat_list.c_str(),
EscapeQueryParamValue(malicious_url.spec(), true).c_str(),
EscapeQueryParamValue(page_url.spec(), true).c_str(),
EscapeQueryParamValue(referrer_url.spec(), true).c_str(),