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

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

Issue 1403001: Modifying the "dangerous download" algorithm. (Closed)
Patch Set: Adding .sys and .drv as Dangerous extensions Created 10 years 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
« no previous file with comments | « chrome/browser/download/download_manager.cc ('k') | chrome/browser/download/download_util.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_prefs.cc
diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc
index 7da48de5aace1c185e4a98e8ae3fab63cd662d95..b4f9ddcb8c74a77f44fa384c67cd17e98d312bf2 100644
--- a/chrome/browser/download/download_prefs.cc
+++ b/chrome/browser/download/download_prefs.cc
@@ -10,6 +10,7 @@
#include "base/sys_string_conversions.h"
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_thread.h"
+#include "chrome/browser/download/download_extensions.h"
#include "chrome/browser/download/download_util.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/common/pref_names.h"
@@ -31,7 +32,7 @@ DownloadPrefs::DownloadPrefs(PrefService* prefs) : prefs_(prefs) {
#elif defined(OS_WIN)
FilePath path(UTF8ToWide(extensions[i]));
#endif
- if (!extensions[i].empty() && !download_util::IsExecutableFile(path))
+ if (!extensions[i].empty() && download_util::IsFileSafe(path))
auto_open_.insert(path.value());
}
}
@@ -88,7 +89,7 @@ bool DownloadPrefs::EnableAutoOpenBasedOnExtension(const FilePath& file_name) {
return false;
DCHECK(extension[0] == FilePath::kExtensionSeparator);
extension.erase(0, 1);
- if (download_util::IsExecutableExtension(extension))
+ if (!download_util::IsFileExtensionSafe(extension))
return false;
auto_open_.insert(extension);
« no previous file with comments | « chrome/browser/download/download_manager.cc ('k') | chrome/browser/download/download_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698