Index: chrome/browser/download/download_extensions.cc |
diff --git a/chrome/browser/download/download_extensions.cc b/chrome/browser/download/download_extensions.cc |
index 623bdf48d855f651fcc7ef343522d450bd9a5fba..6475045897f2e024e8e09345ddacce12fc4b52f4 100644 |
--- a/chrome/browser/download/download_extensions.cc |
+++ b/chrome/browser/download/download_extensions.cc |
@@ -227,6 +227,14 @@ DownloadDangerLevel GetFileDangerLevel(const base::FilePath& path) { |
return NOT_DANGEROUS; |
} |
+bool IsAllowedToOpenAutomatically(const base::FilePath& path) { |
+ // This is probably overly conservative, but the intention is that if the file |
+ // type was dangerous enough to require prompting, then we shouldn't allow |
+ // opening it automatically. |
+ base::FilePath::StringType extension(path.FinalExtension()); |
+ return !extension.empty() && GetFileDangerLevel(path) == NOT_DANGEROUS; |
Randy Smith (Not in Mondays)
2015/06/03 23:44:07
So we no longer allow ALLOW_ON_USER_GESTURE files
Randy Smith (Not in Mondays)
2015/06/03 23:44:07
The !extension.empty() test is redundant with the
asanka
2015/06/04 15:30:48
The check is different. GetFileDangerLevel() retur
|
+} |
+ |
static const char* kExecutableWhiteList[] = { |
// JavaScript is just as powerful as EXE. |
"text/javascript", |