Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(6065)

Unified Diff: chrome/browser/download/download_danger_prompt.h

Issue 1436273002: Send safe browsing ThreatDetails to track download CTR when user tries to recover blocked downloads (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/download/download_danger_prompt.h
diff --git a/chrome/browser/download/download_danger_prompt.h b/chrome/browser/download/download_danger_prompt.h
index e1b5c612c08994378a2e598440e948009d6aef82..5eba5823897ef720e21f312e3cdd0e6b8e7196f9 100644
--- a/chrome/browser/download/download_danger_prompt.h
+++ b/chrome/browser/download/download_danger_prompt.h
@@ -5,7 +5,10 @@
#ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_DANGER_PROMPT_H_
#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_DANGER_PROMPT_H_
+#include <string>
+
#include "base/callback_forward.h"
+#include "url/gurl.h"
namespace content {
class DownloadItem;
@@ -37,15 +40,27 @@ class DownloadDangerPrompt {
// caller does not own the object and receive no guarantees about lifetime.
// If |show_context|, then the prompt message will contain some information
// about the download and its danger; otherwise it won't.
- static DownloadDangerPrompt* Create(
- content::DownloadItem* item,
- content::WebContents* web_contents,
- bool show_context,
- const OnDone& done);
-
- // Only to be used by tests. Subclasses must override to manually call the
- // respective button click handler.
- virtual void InvokeActionForTesting(Action action) = 0;
+ static DownloadDangerPrompt* Create(content::DownloadItem* item,
+ content::WebContents* web_contents,
+ bool show_context,
+ const OnDone& done);
+
+ // Helper function only used by tests. This function returns a serialized
+ // ClientSafeBrowsingReportRequest proto or an empty string. Subclasses must
+ // override to manually call the respective button click handler.
+ virtual std::string InvokeActionForTesting(Action action,
+ const GURL& url) = 0;
+
+ protected:
+ // Return a serialized ClientSafeBrowsingReportRequest proto.
+ std::string CreateSafeBrowsingDownloadRecoveryReport(bool did_proceed,
+ const GURL& url);
+
+ // Sends threat details to safe browsing backend.
+ // Since this reporting is not gated by extended_reporting, it only records
Nathan Parker 2015/11/14 01:04:27 I'd swap the two phrases: Since it only records u
Jialiu Lin 2015/11/16 19:30:14 Done.
+ // download url and user's action (click through or not). We should not put
+ // any other extra information in this report.
+ void SendSerializedReport(const std::string& report);
};
#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_DANGER_PROMPT_H_

Powered by Google App Engine
This is Rietveld 408576698