| Index: chrome/browser/download/chrome_download_manager_delegate.cc
|
| diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
|
| index 37c55d6a14feb6b932b00063801f9f4caf33dbd0..9820b776b37f0109e76f6c919ea65d63320f380a 100644
|
| --- a/chrome/browser/download/chrome_download_manager_delegate.cc
|
| +++ b/chrome/browser/download/chrome_download_manager_delegate.cc
|
| @@ -42,6 +42,7 @@
|
| #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h"
|
| #include "chrome/common/chrome_constants.h"
|
| #include "chrome/common/features.h"
|
| +#include "chrome/common/pdf_uma.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/common/safe_browsing/file_type_policies.h"
|
| #include "chrome/grit/generated_resources.h"
|
| @@ -206,6 +207,8 @@ const DownloadPathReservationTracker::FilenameConflictAction
|
| kDefaultPlatformConflictAction = DownloadPathReservationTracker::UNIQUIFY;
|
| #endif
|
|
|
| +constexpr char kPDFMimeType[] = "application/pdf";
|
| +
|
| } // namespace
|
|
|
| ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile)
|
| @@ -283,6 +286,11 @@ void ChromeDownloadManagerDelegate::ReturnNextId(
|
| bool ChromeDownloadManagerDelegate::DetermineDownloadTarget(
|
| DownloadItem* download,
|
| const content::DownloadTargetCallback& callback) {
|
| + if (download->GetTargetFilePath().empty() &&
|
| + download->GetMimeType() == kPDFMimeType && !download->HasUserGesture()) {
|
| + ReportPDFLoadStatus(PDFLoadStatus::kTriggeredNoGestureDriveByDownload);
|
| + }
|
| +
|
| DownloadTargetDeterminer::CompletionCallback target_determined_callback =
|
| base::Bind(&ChromeDownloadManagerDelegate::OnDownloadTargetDetermined,
|
| weak_ptr_factory_.GetWeakPtr(),
|
|
|