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

Unified Diff: chrome/browser/download/download_util.h

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_util.h
diff --git a/chrome/browser/download/download_util.h b/chrome/browser/download/download_util.h
index 0224a26df98ac5f1b2b668383448f16c7468a7bb..81f3b2a89d6e1ce0fb6ccc5e66586a3ae3df4491 100644
--- a/chrome/browser/download/download_util.h
+++ b/chrome/browser/download/download_util.h
@@ -152,11 +152,24 @@ void DragDownload(const DownloadItem* download,
// Executable file support -----------------------------------------------------
-// Tests if a file is considered executable, based on its type.
-bool IsExecutableFile(const FilePath& path);
+enum DownloadDangerLevel {
+ NotDangerous,
+ AllowOnUserGesture,
+ Dangerous
+};
+
+// Determine the download danger level of a file.
+DownloadDangerLevel GetFileDangerLevel(const FilePath& path);
+
+// Determine the download danger level using a file extension.
+DownloadDangerLevel GetFileExtensionDangerLevel(
+ const FilePath::StringType& extension);
+
+// True if the download danger level of the file is NotDangerous.
+bool IsFileSafe(const FilePath& path);
-// Determine if the specified extension is an executable extension.
-bool IsExecutableExtension(const FilePath::StringType& extension);
+// 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);

Powered by Google App Engine
This is Rietveld 408576698