| OLD | NEW |
| 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 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 720 IsOpenInBrowserPreferreredForFile(target_info->target_path) && | 720 IsOpenInBrowserPreferreredForFile(target_info->target_path) && |
| 721 target_info->is_filetype_handled_safely) | 721 target_info->is_filetype_handled_safely) |
| 722 DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true); | 722 DownloadItemModel(item).SetShouldPreferOpeningInBrowser(true); |
| 723 | 723 |
| 724 if (target_info->is_dangerous_file) | 724 if (target_info->is_dangerous_file) |
| 725 DownloadItemModel(item).SetIsDangerousFileBasedOnType(true); | 725 DownloadItemModel(item).SetIsDangerousFileBasedOnType(true); |
| 726 } | 726 } |
| 727 callback.Run(target_info->target_path, | 727 callback.Run(target_info->target_path, |
| 728 target_info->target_disposition, | 728 target_info->target_disposition, |
| 729 target_info->danger_type, | 729 target_info->danger_type, |
| 730 target_info->intermediate_path); | 730 target_info->intermediate_path, |
| 731 target_info->hide_file_extension); |
| 731 } | 732 } |
| 732 | 733 |
| 733 bool ChromeDownloadManagerDelegate::IsOpenInBrowserPreferreredForFile( | 734 bool ChromeDownloadManagerDelegate::IsOpenInBrowserPreferreredForFile( |
| 734 const base::FilePath& path) { | 735 const base::FilePath& path) { |
| 735 #if defined(OS_WIN) || defined(OS_LINUX) || \ | 736 #if defined(OS_WIN) || defined(OS_LINUX) || \ |
| 736 (defined(OS_MACOSX) && !defined(OS_IOS)) | 737 (defined(OS_MACOSX) && !defined(OS_IOS)) |
| 737 if (path.MatchesExtension(FILE_PATH_LITERAL(".pdf"))) { | 738 if (path.MatchesExtension(FILE_PATH_LITERAL(".pdf"))) { |
| 738 return !download_prefs_->ShouldOpenPdfInSystemReader(); | 739 return !download_prefs_->ShouldOpenPdfInSystemReader(); |
| 739 } | 740 } |
| 740 #endif | 741 #endif |
| (...skipping 12 matching lines...) Expand all Loading... |
| 753 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || | 754 path.MatchesExtension(FILE_PATH_LITERAL(".xht")) || |
| 754 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || | 755 path.MatchesExtension(FILE_PATH_LITERAL(".xhtm")) || |
| 755 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || | 756 path.MatchesExtension(FILE_PATH_LITERAL(".xhtml")) || |
| 756 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || | 757 path.MatchesExtension(FILE_PATH_LITERAL(".xsl")) || |
| 757 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { | 758 path.MatchesExtension(FILE_PATH_LITERAL(".xslt"))) { |
| 758 return true; | 759 return true; |
| 759 } | 760 } |
| 760 #endif | 761 #endif |
| 761 return false; | 762 return false; |
| 762 } | 763 } |
| OLD | NEW |