diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-03 05:49:07 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-03 05:49:07 +0000 |
commit | 6abda2beaab65557677190183486491d01e4de37 (patch) | |
tree | f83d237daf9cdcd88a8feef8de5ac0e8def2e771 /chrome/browser/download/download_target_determiner.h | |
parent | e70238a66522e04554fb688078b842d9d9b5937f (diff) | |
download | chromium_src-6abda2beaab65557677190183486491d01e4de37.zip chromium_src-6abda2beaab65557677190183486491d01e4de37.tar.gz chromium_src-6abda2beaab65557677190183486491d01e4de37.tar.bz2 |
Windows: Add an "Open in Adobe Reader" menu item for PDF files in the download shelf.
BUG=370746
Review URL: https://codereview.chromium.org/324593004
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281172 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/download/download_target_determiner.h')
-rw-r--r-- | chrome/browser/download/download_target_determiner.h | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/chrome/browser/download/download_target_determiner.h b/chrome/browser/download/download_target_determiner.h index f57341d..8cca804 100644 --- a/chrome/browser/download/download_target_determiner.h +++ b/chrome/browser/download/download_target_determiner.h @@ -80,6 +80,13 @@ class DownloadTargetDeterminer // Returns a .crdownload intermediate path for the |suggested_path|. static base::FilePath GetCrDownloadPath(const base::FilePath& suggested_path); +#if defined(OS_WIN) + // Returns true if Adobe Reader is up to date. This information refreshed + // only when Start() gets called for a PDF and Adobe Reader is the default + // System PDF viewer. + static bool IsAdobeReaderUpToDate(); +#endif + private: // The main workflow is controlled via a set of state transitions. Each state // has an associated handler. The handler for STATE_FOO is DoFoo. Each handler @@ -94,6 +101,7 @@ class DownloadTargetDeterminer STATE_DETERMINE_LOCAL_PATH, STATE_DETERMINE_MIME_TYPE, STATE_DETERMINE_IF_HANDLED_SAFELY_BY_BROWSER, + STATE_DETERMINE_IF_ADOBE_READER_UP_TO_DATE, STATE_CHECK_DOWNLOAD_URL, STATE_CHECK_VISITED_REFERRER_BEFORE, STATE_DETERMINE_INTERMEDIATE_PATH, @@ -206,12 +214,26 @@ class DownloadTargetDeterminer // Determine if the file type can be handled safely by the browser if it were // to be opened via a file:// URL. // Next state: - // - STATE_CHECK_DOWNLOAD_URL. + // - STATE_DETERMINE_IF_ADOBE_READER_UP_TO_DATE. Result DoDetermineIfHandledSafely(); +#if defined(ENABLE_PLUGINS) // Callback invoked when a decision is available about whether the file type // can be handled safely by the browser. void DetermineIfHandledSafelyDone(bool is_handled_safely); +#endif + + // Determine if Adobe Reader is up to date. Only do the check on Windows for + // .pdf file targets. + // Next state: + // - STATE_CHECK_DOWNLOAD_URL. + Result DoDetermineIfAdobeReaderUpToDate(); + +#if defined(OS_WIN) + // Callback invoked when a decision is available about whether Adobe Reader + // is up to date. + void DetermineIfAdobeReaderUpToDateDone(bool adobe_reader_up_to_date); +#endif // Checks whether the downloaded URL is malicious. Invokes the // DownloadProtectionService via the delegate. |