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

Unified Diff: chrome/browser/download/download_target_determiner.h

Issue 324593004: Windows: Add an "Open in Adobe Reader" menu item for PDF files in the download shelf. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: self review Created 6 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/download/download_target_determiner.h
diff --git a/chrome/browser/download/download_target_determiner.h b/chrome/browser/download/download_target_determiner.h
index a24433149e8f701ab7a56ec8f4c4fbb57d2e76a4..4f6e5c0221a13448e3be80b4631df0f298a6efbd 100644
--- a/chrome/browser/download/download_target_determiner.h
+++ b/chrome/browser/download/download_target_determiner.h
@@ -79,6 +79,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
@@ -93,6 +100,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,
@@ -205,12 +213,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.

Powered by Google App Engine
This is Rietveld 408576698