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

Side by Side Diff: chrome/browser/download/chrome_download_manager_delegate.cc

Issue 665163005: Add option to open PDFs in system viewer to OS X and Linux. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Harmonize the strings a bit better. Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/download/download_prefs.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/download/chrome_download_manager_delegate.h" 5 #include "chrome/browser/download/chrome_download_manager_delegate.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after
712 bool ChromeDownloadManagerDelegate::IsOpenInBrowserPreferreredForFile( 712 bool ChromeDownloadManagerDelegate::IsOpenInBrowserPreferreredForFile(
713 const base::FilePath& path) { 713 const base::FilePath& path) {
714 // On Windows, PDFs should open in Acrobat Reader if the user chooses. 714 // On Windows, PDFs should open in Acrobat Reader if the user chooses.
715 #if defined(OS_WIN) 715 #if defined(OS_WIN)
716 if (path.MatchesExtension(FILE_PATH_LITERAL(".pdf")) && 716 if (path.MatchesExtension(FILE_PATH_LITERAL(".pdf")) &&
717 DownloadTargetDeterminer::IsAdobeReaderUpToDate()) { 717 DownloadTargetDeterminer::IsAdobeReaderUpToDate()) {
718 return !download_prefs_->ShouldOpenPdfInAdobeReader(); 718 return !download_prefs_->ShouldOpenPdfInAdobeReader();
719 } 719 }
720 #endif 720 #endif
721 721
722 #if defined(OS_MACOSX) || defined(OS_LINUX)
Lei Zhang 2014/10/21 11:07:06 I'm not 100% sure what pieces of code Chrome for i
palmer 2014/10/21 20:31:49 OK, checking for defined(OS_MACOSX) && !defined(OS
723 if (path.MatchesExtension(FILE_PATH_LITERAL(".pdf"))) {
724 return !download_prefs_->ShouldOpenPdfInSystemReader();
725 }
726 #endif
727
722 // On Android, always prefer opening with an external app. On ChromeOS, there 728 // On Android, always prefer opening with an external app. On ChromeOS, there
723 // are no external apps so just allow all opens to be handled by the "System." 729 // are no external apps so just allow all opens to be handled by the "System."
724 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && defined(ENABLE_PLUGINS) 730 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) && defined(ENABLE_PLUGINS)
725 // TODO(asanka): Consider other file types and MIME types. 731 // TODO(asanka): Consider other file types and MIME types.
726 // http://crbug.com/323561 732 // http://crbug.com/323561
727 if (path.MatchesExtension(FILE_PATH_LITERAL(".pdf")) || 733 if (path.MatchesExtension(FILE_PATH_LITERAL(".pdf")) ||
728 path.MatchesExtension(FILE_PATH_LITERAL(".htm")) || 734 path.MatchesExtension(FILE_PATH_LITERAL(".htm")) ||
729 path.MatchesExtension(FILE_PATH_LITERAL(".html")) || 735 path.MatchesExtension(FILE_PATH_LITERAL(".html")) ||
730 path.MatchesExtension(FILE_PATH_LITERAL(".shtm")) || 736 path.MatchesExtension(FILE_PATH_LITERAL(".shtm")) ||
731 path.MatchesExtension(FILE_PATH_LITERAL(".shtml")) || 737 path.MatchesExtension(FILE_PATH_LITERAL(".shtml")) ||
732 path.MatchesExtension(FILE_PATH_LITERAL(".svg")) || 738 path.MatchesExtension(FILE_PATH_LITERAL(".svg")) ||
733 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || 739 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) ||
734 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || 740 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) ||
735 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || 741 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) ||
736 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || 742 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) ||
737 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { 743 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) {
738 return true; 744 return true;
739 } 745 }
740 #endif 746 #endif
741 return false; 747 return false;
742 } 748 }
OLDNEW
« no previous file with comments | « chrome/app/generated_resources.grd ('k') | chrome/browser/download/download_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698