| 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..01b93cd245e1c2fb81ed7af2eab612944b021bb9 100644
|
| --- a/chrome/browser/ui/cocoa/download/download_danger_prompt_impl.cc
|
| +++ b/chrome/browser/ui/cocoa/download/download_danger_prompt_impl.cc
|
| @@ -8,6 +8,7 @@
|
| #include "base/strings/utf_string_conversions.h"
|
| #include "chrome/browser/download/download_stats.h"
|
| #include "chrome/browser/extensions/api/experience_sampling_private/experience_sampling.h"
|
| +#include "chrome/browser/safe_browsing/download_protection_service.h"
|
| #include "chrome/browser/ui/tab_modal_confirm_dialog.h"
|
| #include "chrome/browser/ui/tab_modal_confirm_dialog_delegate.h"
|
| #include "chrome/grit/chromium_strings.h"
|
| @@ -20,6 +21,7 @@
|
| #include "url/gurl.h"
|
|
|
| using extensions::ExperienceSamplingEvent;
|
| +using safe_browsing::ClientSafeBrowsingReportRequest;
|
|
|
| namespace {
|
|
|
| @@ -57,6 +59,9 @@ class DownloadDangerPromptImpl : public DownloadDangerPrompt,
|
| void RunDone(Action action);
|
|
|
| content::DownloadItem* download_;
|
| + // If show_context_ is true, this is a download confirmation dialog by
|
| + // download API, otherwise it is download recovery dialog from a regular
|
| + // download.
|
| bool show_context_;
|
| OnDone done_;
|
|
|
| @@ -250,7 +255,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);
|
|
|