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

Unified Diff: chrome/browser/ui/views/download/download_danger_prompt_views.cc

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/ui/views/download/download_danger_prompt_views.cc
diff --git a/chrome/browser/ui/views/download/download_danger_prompt_views.cc b/chrome/browser/ui/views/download/download_danger_prompt_views.cc
index ef7bbfbb06f7c2abbb1c223fa115c6cfe3418899..70e729bcc926b2760caabfb4d685584312351ebb 100644
--- a/chrome/browser/ui/views/download/download_danger_prompt_views.cc
+++ b/chrome/browser/ui/views/download/download_danger_prompt_views.cc
@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include "base/compiler_specific.h"
+
msw 2015/11/13 19:01:28 Remove this blank line or just put download_danger
Jialiu Lin 2015/11/13 23:47:01 oops, sorry
#include "chrome/browser/download/download_danger_prompt.h"
#include "chrome/browser/download/download_stats.h"
#include "chrome/browser/extensions/api/experience_sampling_private/experience_sampling.h"
@@ -41,7 +42,8 @@ class DownloadDangerPromptViews : public DownloadDangerPrompt,
const OnDone& done);
// DownloadDangerPrompt methods:
- void InvokeActionForTesting(Action action) override;
+ std::string InvokeActionForTesting(Action action,
+ const GURL& testing_url) override;
msw 2015/11/13 19:01:28 nit: use |url| here and below to match the base cl
Jialiu Lin 2015/11/13 23:47:01 Done.
// views::DialogDelegate methods:
base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
@@ -132,7 +134,9 @@ DownloadDangerPromptViews::DownloadDangerPromptViews(
}
// DownloadDangerPrompt methods:
-void DownloadDangerPromptViews::InvokeActionForTesting(Action action) {
+std::string DownloadDangerPromptViews::InvokeActionForTesting(
msw 2015/11/13 19:01:28 This looks like a near-copy of DownloadDangerPromp
Jialiu Lin 2015/11/13 23:47:00 They looks like the same, however, the Accept() in
msw 2015/11/17 01:17:37 This is troubling... someone more familiar here sh
msw 2015/11/17 18:54:40 My approval is gated on someone familiar with this
Jialiu Lin 2015/11/17 19:13:53 asanka (already in reviewer list) would be the exp
+ Action action,
+ const GURL& testing_url) {
switch (action) {
case ACCEPT:
Accept();
@@ -147,6 +151,9 @@ void DownloadDangerPromptViews::InvokeActionForTesting(Action action) {
NOTREACHED();
break;
}
+
+ return CreateSafeBrowsingDownloadRecoveryReport(action == ACCEPT,
+ testing_url);
}
// views::DialogDelegate methods:
@@ -333,6 +340,12 @@ void DownloadDangerPromptViews::RunDone(Action action) {
OnDone done = done_;
done_.Reset();
if (download_ != NULL) {
+ if (download_->GetURL() != GURL::EmptyGURL()) {
msw 2015/11/13 19:01:28 nit: use GURL::is_empty()
Jialiu Lin 2015/11/13 23:47:00 Done.
+ std::string report = CreateSafeBrowsingDownloadRecoveryReport(
+ action == DownloadDangerPrompt::ACCEPT, download_->GetURL());
+ if (!report.empty())
+ SendSerializedReport(report);
+ }
download_->RemoveObserver(this);
download_ = NULL;
}

Powered by Google App Engine
This is Rietveld 408576698