| 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..55dd7fecbeff13f21ba1ae1ada2d8e810b05910b 100644
|
| --- a/chrome/browser/download/chrome_download_manager_delegate.cc
|
| +++ b/chrome/browser/download/chrome_download_manager_delegate.cc
|
| @@ -78,6 +78,10 @@
|
| #include "extensions/common/constants.h"
|
| #endif
|
|
|
| +#if BUILDFLAG(ENABLE_PLUGINS)
|
| +#include "chrome/common/pdf_uma.h"
|
| +#endif
|
| +
|
| using content::BrowserThread;
|
| using content::DownloadItem;
|
| using content::DownloadManager;
|
| @@ -206,6 +210,10 @@ const DownloadPathReservationTracker::FilenameConflictAction
|
| kDefaultPlatformConflictAction = DownloadPathReservationTracker::UNIQUIFY;
|
| #endif
|
|
|
| +#if BUILDFLAG(ENABLE_PLUGINS)
|
| +constexpr char kPDFMimeType[] = "application/pdf";
|
| +#endif
|
| +
|
| } // namespace
|
|
|
| ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile)
|
| @@ -283,6 +291,13 @@ void ChromeDownloadManagerDelegate::ReturnNextId(
|
| bool ChromeDownloadManagerDelegate::DetermineDownloadTarget(
|
| DownloadItem* download,
|
| const content::DownloadTargetCallback& callback) {
|
| +#if BUILDFLAG(ENABLE_PLUGINS)
|
| + if (download->GetTargetFilePath().empty() &&
|
| + download->GetMimeType() == kPDFMimeType && !download->HasUserGesture()) {
|
| + ReportPDFLoadStatus(PDFLoadStatus::TRIGGERED_NO_GESTURE_DRIVE_BY_DOWNLOAD);
|
| + }
|
| +#endif
|
| +
|
| DownloadTargetDeterminer::CompletionCallback target_determined_callback =
|
| base::Bind(&ChromeDownloadManagerDelegate::OnDownloadTargetDetermined,
|
| weak_ptr_factory_.GetWeakPtr(),
|
|
|