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

Unified Diff: chrome/browser/download/chrome_download_manager_delegate.cc

Issue 390983004: Merge 281172 "Windows: Add an "Open in Adobe Reader" menu item f..." (Closed) Base URL: svn://svn.chromium.org/chrome/branches/2062/src/
Patch Set: Created 6 years, 5 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/chrome_download_manager_delegate.cc
===================================================================
--- chrome/browser/download/chrome_download_manager_delegate.cc (revision 283043)
+++ chrome/browser/download/chrome_download_manager_delegate.cc (working copy)
@@ -184,29 +184,6 @@
return mime_type;
}
-bool IsOpenInBrowserPreferreredForFile(const base::FilePath& path) {
- // On Android, always prefer opening with an external app. On ChromeOS, there
- // are no external apps so just allow all opens to be handled by the "System."
-#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && defined(ENABLE_PLUGINS)
- // TODO(asanka): Consider other file types and MIME types.
- // http://crbug.com/323561
- if (path.MatchesExtension(FILE_PATH_LITERAL(".pdf")) ||
- path.MatchesExtension(FILE_PATH_LITERAL(".htm")) ||
- path.MatchesExtension(FILE_PATH_LITERAL(".html")) ||
- path.MatchesExtension(FILE_PATH_LITERAL(".shtm")) ||
- path.MatchesExtension(FILE_PATH_LITERAL(".shtml")) ||
- path.MatchesExtension(FILE_PATH_LITERAL(".svg")) ||
- path.MatchesExtension(FILE_PATH_LITERAL(".xht")) ||
- path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) ||
- path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) ||
- path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) ||
- path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) {
- return true;
- }
-#endif
- return false;
-}
-
} // namespace
ChromeDownloadManagerDelegate::ChromeDownloadManagerDelegate(Profile* profile)
@@ -722,3 +699,35 @@
target_info->danger_type,
target_info->intermediate_path);
}
+
+bool ChromeDownloadManagerDelegate::IsOpenInBrowserPreferreredForFile(
+ const base::FilePath& path) {
+ // On Windows, PDFs should open in Acrobat Reader if the user chooses.
+#if defined(OS_WIN)
+ if (path.MatchesExtension(FILE_PATH_LITERAL(".pdf")) &&
+ DownloadTargetDeterminer::IsAdobeReaderUpToDate()) {
+ return !download_prefs_->ShouldOpenPdfInAdobeReader();
+ }
+#endif
+
+ // On Android, always prefer opening with an external app. On ChromeOS, there
+ // are no external apps so just allow all opens to be handled by the "System."
+#if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && defined(ENABLE_PLUGINS)
+ // TODO(asanka): Consider other file types and MIME types.
+ // http://crbug.com/323561
+ if (path.MatchesExtension(FILE_PATH_LITERAL(".pdf")) ||
+ path.MatchesExtension(FILE_PATH_LITERAL(".htm")) ||
+ path.MatchesExtension(FILE_PATH_LITERAL(".html")) ||
+ path.MatchesExtension(FILE_PATH_LITERAL(".shtm")) ||
+ path.MatchesExtension(FILE_PATH_LITERAL(".shtml")) ||
+ path.MatchesExtension(FILE_PATH_LITERAL(".svg")) ||
+ path.MatchesExtension(FILE_PATH_LITERAL(".xht")) ||
+ path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) ||
+ path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) ||
+ path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) ||
+ path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) {
+ return true;
+ }
+#endif
+ return false;
+}
« no previous file with comments | « chrome/browser/download/chrome_download_manager_delegate.h ('k') | chrome/browser/download/download_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698