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

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

Issue 1403001: Modifying the "dangerous download" algorithm. (Closed)
Patch Set: Removing unnecessary namespace qualifier Created 10 years, 1 month 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/download_prefs.cc
diff --git a/chrome/browser/download/download_prefs.cc b/chrome/browser/download/download_prefs.cc
index 8673e0ac4e5a5302e569acc221a67bbfe4ad80ca..62c5b35ea137e7f0a5fa0d3c6f01a102f0e7485b 100644
--- a/chrome/browser/download/download_prefs.cc
+++ b/chrome/browser/download/download_prefs.cc
@@ -30,7 +30,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());
}
}
@@ -87,7 +87,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);

Powered by Google App Engine
This is Rietveld 408576698