diff options
Diffstat (limited to 'chromium/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.h')
-rw-r--r-- | chromium/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.h | 52 |
1 files changed, 48 insertions, 4 deletions
diff --git a/chromium/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.h b/chromium/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.h index 9a3441613dc..754a73b3f64 100644 --- a/chromium/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.h +++ b/chromium/chrome/browser/extensions/api/safe_browsing_private/safe_browsing_private_event_router.h @@ -59,6 +59,9 @@ class SafeBrowsingPrivateEventRouter : public KeyedService { static const char kKeyClickedThrough[]; static const char kKeyTriggeredRules[]; static const char kKeyThreatType[]; + static const char kKeyContentType[]; + static const char kKeyContentSize[]; + static const char kKeyTrigger[]; static const char kKeyPasswordReuseEvent[]; static const char kKeyPasswordChangedEvent[]; @@ -67,6 +70,11 @@ class SafeBrowsingPrivateEventRouter : public KeyedService { static const char kKeySensitiveDataEvent[]; static const char kKeyLargeUnscannedFileEvent[]; + // String constants for the "trigger" event field. + static const char kTriggerFileDownload[]; + static const char kTriggerFileUpload[]; + static const char kTriggerWebContentUpload[]; + explicit SafeBrowsingPrivateEventRouter(content::BrowserContext* context); ~SafeBrowsingPrivateEventRouter() override; @@ -83,7 +91,9 @@ class SafeBrowsingPrivateEventRouter : public KeyedService { // Notifies listeners that the user just opened a dangerous download. void OnDangerousDownloadOpened(const GURL& url, const std::string& file_name, - const std::string& download_digest_sha256); + const std::string& download_digest_sha256, + const std::string& mime_type, + const int64_t content_size); // Notifies listeners that the user saw a security interstitial. void OnSecurityInterstitialShown(const GURL& url, @@ -99,19 +109,53 @@ class SafeBrowsingPrivateEventRouter : public KeyedService { void OnDangerousDeepScanningResult(const GURL& url, const std::string& file_name, const std::string& download_digest_sha256, - const std::string& threat_type); + const std::string& threat_type, + const std::string& mime_type, + const std::string& trigger, + const int64_t content_size); // Notifies listeners that scanning for sensitive data detected a violation. void OnSensitiveDataEvent( const safe_browsing::DlpDeepScanningVerdict& verdict, const GURL& url, const std::string& file_name, - const std::string& download_digest_sha256); + const std::string& download_digest_sha256, + const std::string& mime_type, + const std::string& trigger, + const int64_t content_size); // Notifies listeners that deep scanning failed, since the file was too large. void OnLargeUnscannedFileEvent(const GURL& url, const std::string& file_name, - const std::string& download_digest_sha256); + const std::string& download_digest_sha256, + const std::string& mime_type, + const std::string& trigger, + const int64_t content_size); + + // Notifies listeners that the user saw a download warning. + // - |url| is the download URL + // - |file_name| is the path on disk + // - |download_digest_sha256| is the hex-encoded SHA256 + // - |threat_type| is the danger type of the download. + void OnDangerousDownloadWarning(const GURL& url, + const std::string& file_name, + const std::string& download_digest_sha256, + const std::string& threat_type, + const std::string& mime_type, + const int64_t content_size); + + // Notifies listeners that the user bypassed a download warning. + // - |url| is the download URL + // - |file_name| is the path on disk + // - |download_digest_sha256| is the hex-encoded SHA256 + // - |threat_type| is the danger type of the download. + void OnDangerousDownloadWarningBypassed( + const GURL& url, + const std::string& file_name, + const std::string& download_digest_sha256, + const std::string& threat_type, + const std::string& mime_type, + const int64_t content_size); void SetCloudPolicyClientForTesting( std::unique_ptr<policy::CloudPolicyClient> client); |