Add token field to ClientSafeBrowsingReportReqeust.
In order to calculate CTRs of bad downloads, safe browsing needs information to
link ClientSafeBrowsingReportRequest (for downloads) and ClientDownloadResponse.
To achieve this, we add a token field to identify its corresponding
ClientDownloadResponse in the ClientSafeBrowsingReportRequest, and propagate it
with the same string in ClientDownloadResponse.token.
Also add a new download report type (DANGEROUS_DOWNLOAD_BY_API) to separately
track CTR of dangerous downloads go through download API.
BUG=615511
Review-Url: https://codereview.chromium.org/2029903002
Cr-Commit-Position: refs/heads/master@{#398699}
diff --git a/chrome/browser/download/download_danger_prompt.h b/chrome/browser/download/download_danger_prompt.h
index 4301ea6..de31c05 100644
--- a/chrome/browser/download/download_danger_prompt.h
+++ b/chrome/browser/download/download_danger_prompt.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_DANGER_PROMPT_H_
#include "base/callback_forward.h"
+#include "chrome/common/safe_browsing/csd.pb.h"
class GURL;
@@ -58,7 +59,8 @@
// by user's extended reporting preference (i.e.
// prefs::kSafeBrowsingExtendedReportingEnabled). We should not put any extra
// information in this report.
- static void SendSafeBrowsingDownloadRecoveryReport(
+ static void SendSafeBrowsingDownloadReport(
+ safe_browsing::ClientSafeBrowsingReportRequest::ReportType report_type,
bool did_proceed,
const content::DownloadItem& download);