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

Unified Diff: chrome/browser/ui/cocoa/download/download_danger_prompt_impl.cc

Issue 2029903002: Add token field to ClientSafeBrowsingReportReqeust (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: tweak comments Created 4 years, 6 months 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/cocoa/download/download_danger_prompt_impl.cc
diff --git a/chrome/browser/ui/cocoa/download/download_danger_prompt_impl.cc b/chrome/browser/ui/cocoa/download/download_danger_prompt_impl.cc
index cec27721ada6b8e745d4ecb207723e1eba669935..71420a95d918bc74d8ad87a33c2c95ab353e9e9f 100644
--- a/chrome/browser/ui/cocoa/download/download_danger_prompt_impl.cc
+++ b/chrome/browser/ui/cocoa/download/download_danger_prompt_impl.cc
@@ -20,6 +20,7 @@
#include "url/gurl.h"
using extensions::ExperienceSamplingEvent;
+using safe_browsing::ClientSafeBrowsingReportRequest;
namespace {
@@ -57,6 +58,9 @@ class DownloadDangerPromptImpl : public DownloadDangerPrompt,
void RunDone(Action action);
content::DownloadItem* download_;
+ // show_context_ is true, this is a comfirming download dialog (through
+ // download API), otherwise it is download recovery dialog from a regular
+ // download.
bool show_context_;
OnDone done_;
@@ -250,7 +254,11 @@ void DownloadDangerPromptImpl::RunDone(Action action) {
RecordDownloadDangerPrompt(accept, *download_);
if (!download_->GetURL().is_empty() &&
!download_->GetBrowserContext()->IsOffTheRecord()) {
- SendSafeBrowsingDownloadRecoveryReport(accept, *download_);
+ ClientSafeBrowsingReportRequest::ReportType report_type
+ = show_context_ ?
+ ClientSafeBrowsingReportRequest::DANGEROUS_DOWNLOAD_BY_API :
+ ClientSafeBrowsingReportRequest::DANGEROUS_DOWNLOAD_RECOVERY;
+ SendSafeBrowsingDownloadReport(report_type, accept, *download_);
}
}
download_->RemoveObserver(this);

Powered by Google App Engine
This is Rietveld 408576698