diff options
Diffstat (limited to 'chrome/browser/download')
-rw-r--r-- | chrome/browser/download/download_extensions.cc | 4 | ||||
-rw-r--r-- | chrome/browser/download/download_extensions.h | 3 | ||||
-rw-r--r-- | chrome/browser/download/download_item.cc | 3 | ||||
-rw-r--r-- | chrome/browser/download/download_manager.cc | 2 | ||||
-rw-r--r-- | chrome/browser/download/download_manager_unittest.cc | 7 | ||||
-rw-r--r-- | chrome/browser/download/download_prefs.cc | 2 |
6 files changed, 7 insertions, 14 deletions
diff --git a/chrome/browser/download/download_extensions.cc b/chrome/browser/download/download_extensions.cc index 52aa565..b9cac1b 100644 --- a/chrome/browser/download/download_extensions.cc +++ b/chrome/browser/download/download_extensions.cc @@ -213,10 +213,6 @@ DownloadDangerLevel GetFileExtensionDangerLevel( return NotDangerous; } -bool IsFileExtensionSafe(const FilePath::StringType& extension) { - return GetFileExtensionDangerLevel(extension) == NotDangerous; -} - bool IsFileSafe(const FilePath& path) { return GetFileDangerLevel(path) == NotDangerous; } diff --git a/chrome/browser/download/download_extensions.h b/chrome/browser/download/download_extensions.h index 3a7c557..022f2cd 100644 --- a/chrome/browser/download/download_extensions.h +++ b/chrome/browser/download/download_extensions.h @@ -28,9 +28,6 @@ DownloadDangerLevel GetFileExtensionDangerLevel( // True if the download danger level of the file is NotDangerous. bool IsFileSafe(const FilePath& path); -// True if the download danger level of the extension is NotDangerous. -bool IsFileExtensionSafe(const FilePath::StringType& extension); - // Tests if we think the server means for this mime_type to be executable. bool IsExecutableMimeType(const std::string& mime_type); diff --git a/chrome/browser/download/download_item.cc b/chrome/browser/download/download_item.cc index f6bee14..db0c9ea 100644 --- a/chrome/browser/download/download_item.cc +++ b/chrome/browser/download/download_item.cc @@ -197,8 +197,7 @@ void DownloadItem::NotifyObserversDownloadFileCompleted() { } bool DownloadItem::CanOpenDownload() { - return !Extension::IsExtension(target_name_) && - download_util::IsFileSafe(target_name_); + return !Extension::IsExtension(target_name_); } bool DownloadItem::ShouldOpenFileBasedOnExtension() { diff --git a/chrome/browser/download/download_manager.cc b/chrome/browser/download/download_manager.cc index 69f228e..268c417 100644 --- a/chrome/browser/download/download_manager.cc +++ b/chrome/browser/download/download_manager.cc @@ -854,8 +854,6 @@ bool DownloadManager::ShouldOpenFileBasedOnExtension( FilePath::StringType extension = path.Extension(); if (extension.empty()) return false; - if (!download_util::IsFileExtensionSafe(extension)) - return false; if (Extension::IsExtension(path)) return false; DCHECK(extension[0] == FilePath::kExtensionSeparator); diff --git a/chrome/browser/download/download_manager_unittest.cc b/chrome/browser/download/download_manager_unittest.cc index 210788d..2db13be 100644 --- a/chrome/browser/download/download_manager_unittest.cc +++ b/chrome/browser/download/download_manager_unittest.cc @@ -112,10 +112,15 @@ const struct { true, false, true, }, - { "http://www.foo.com/always_prompt.pdf", + { "http://www.foo.com/sometimes_prompt.pdf", "application/pdf", false, true, + false, }, + { "http://www.foo.com/always_prompt.jar", + "application/jar", + false, + true, true, }, }; diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc index b4f9ddc..40be829 100644 --- a/chrome/browser/download/download_prefs.cc +++ b/chrome/browser/download/download_prefs.cc @@ -89,8 +89,6 @@ bool DownloadPrefs::EnableAutoOpenBasedOnExtension(const FilePath& file_name) { return false; DCHECK(extension[0] == FilePath::kExtensionSeparator); extension.erase(0, 1); - if (!download_util::IsFileExtensionSafe(extension)) - return false; auto_open_.insert(extension); SaveAutoOpenState(); |