OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 | 5 |
6 #include "chrome/browser/download/download_safe_browsing_client.h" | 6 #include "chrome/browser/download/download_safe_browsing_client.h" |
7 | 7 |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 UpdateDownloadCheckStats(DOWNLOAD_HASH_CHECKS_TOTAL); | 151 UpdateDownloadCheckStats(DOWNLOAD_HASH_CHECKS_TOTAL); |
152 if (is_dangerous) { | 152 if (is_dangerous) { |
153 UpdateDownloadCheckStats(DOWNLOAD_HASH_CHECKS_MALWARE); | 153 UpdateDownloadCheckStats(DOWNLOAD_HASH_CHECKS_MALWARE); |
154 ReportMalware(result); | 154 ReportMalware(result); |
155 } | 155 } |
156 } | 156 } |
157 } | 157 } |
158 | 158 |
159 void DownloadSBClient::ReportMalware( | 159 void DownloadSBClient::ReportMalware( |
160 SafeBrowsingService::UrlCheckResult result) { | 160 SafeBrowsingService::UrlCheckResult result) { |
161 sb_service_->ReportSafeBrowsingHit(url_chain_.back(), // malicious_url | 161 sb_service_->ReportSafeBrowsingHitWithChain(url_chain_, |
162 url_chain_.front(), // page_url | 162 referrer_url_, |
163 referrer_url_, | 163 true, |
164 true, | 164 result); |
165 result); | |
166 } | 165 } |
167 | 166 |
168 void DownloadSBClient::UpdateDownloadCheckStats(SBStatsType stat_type) { | 167 void DownloadSBClient::UpdateDownloadCheckStats(SBStatsType stat_type) { |
169 UMA_HISTOGRAM_ENUMERATION("SB2.DownloadChecks", | 168 UMA_HISTOGRAM_ENUMERATION("SB2.DownloadChecks", |
170 stat_type, | 169 stat_type, |
171 DOWNLOAD_CHECKS_MAX); | 170 DOWNLOAD_CHECKS_MAX); |
172 } | 171 } |
OLD | NEW |