Code: void SafeBrowsingPrivateEventRouter::OnDangerousDeepScanningResult(
    const GURL& url,
     const std::string& file_name,
     const std::string& download_digest_sha256) {
   if (client_) {
     base::Value event(base::Value::Type::DICTIONARY);
     event.SetStringKey(kKeyUrl, url.spec());
     event.SetStringKey(kKeyFileName, file_name);
    event.SetStringKey(kKeyDownloadDigestSha256, download_digest_sha256);
    event.SetStringKey(kKeyProfileUserName, GetProfileUserName());
    ReportRealtimeEvent(kKeyDangerousDownloadEvent, std::move(event));
   }
 }

Commit Message: Add reporting for DLP deep scanning

For each triggered rule in the DLP response, we report the download as
violating that rule.

This also implements the UnsafeReportingEnabled enterprise policy, which
controls whether or not we do any reporting.

Bug: 980777
Change-Id: I48100cfb4dd5aa92ed80da1f34e64a6e393be2fa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1772381
Commit-Queue: Daniel Rubery <drubery@chromium.org>
Reviewed-by: Karan Bhatia <karandeepb@chromium.org>
Reviewed-by: Roger Tawa <rogerta@chromium.org>
Cr-Commit-Position: refs/heads/master@{#691371}
CWE ID: CWE-416
void SafeBrowsingPrivateEventRouter::OnDangerousDeepScanningResult(
    const GURL& url,
     const std::string& file_name,
     const std::string& download_digest_sha256) {
   if (client_) {
    // Create a real-time event dictionary from the arguments and report it.
     base::Value event(base::Value::Type::DICTIONARY);
     event.SetStringKey(kKeyUrl, url.spec());
     event.SetStringKey(kKeyFileName, file_name);
    event.SetStringKey(kKeyDownloadDigestSha256, download_digest_sha256);
    event.SetStringKey(kKeyProfileUserName, GetProfileUserName());
    ReportRealtimeEvent(kKeyDangerousDownloadEvent, std::move(event));
   }
 }
