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

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: tweak on comment 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..d7ca46c7aef9a5294eddc532c725fa86e001e7d8 100644
--- a/chrome/browser/ui/views/download/download_danger_prompt_views.cc
+++ b/chrome/browser/ui/views/download/download_danger_prompt_views.cc
@@ -2,8 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/compiler_specific.h"
#include "chrome/browser/download/download_danger_prompt.h"
+
+#include "base/compiler_specific.h"
#include "chrome/browser/download/download_stats.h"
#include "chrome/browser/extensions/api/experience_sampling_private/experience_sampling.h"
#include "chrome/grit/chromium_strings.h"
@@ -41,7 +42,7 @@ class DownloadDangerPromptViews : public DownloadDangerPrompt,
const OnDone& done);
// DownloadDangerPrompt methods:
- void InvokeActionForTesting(Action action) override;
+ std::string InvokeActionForTesting(Action action, const GURL& url) override;
// views::DialogDelegate methods:
base::string16 GetDialogButtonLabel(ui::DialogButton button) const override;
@@ -132,7 +133,8 @@ DownloadDangerPromptViews::DownloadDangerPromptViews(
}
// DownloadDangerPrompt methods:
-void DownloadDangerPromptViews::InvokeActionForTesting(Action action) {
+std::string DownloadDangerPromptViews::InvokeActionForTesting(Action action,
+ const GURL& url) {
switch (action) {
case ACCEPT:
Accept();
@@ -147,6 +149,8 @@ void DownloadDangerPromptViews::InvokeActionForTesting(Action action) {
NOTREACHED();
break;
}
+
+ return CreateSafeBrowsingDownloadRecoveryReport(action == ACCEPT, url);
}
// views::DialogDelegate methods:
@@ -333,6 +337,10 @@ void DownloadDangerPromptViews::RunDone(Action action) {
OnDone done = done_;
done_.Reset();
if (download_ != NULL) {
+ if (!download_->GetURL().is_empty()) {
+ SendSafeBrowsingDownloadRecoveryReport(
+ action == DownloadDangerPrompt::ACCEPT, download_->GetURL());
+ }
download_->RemoveObserver(this);
download_ = NULL;
}

Powered by Google App Engine
This is Rietveld 408576698