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

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

Issue 5603008: Modify the "dangerous download" algorithm as follows. Original patch by Pier... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: 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_exe.cc ('k') | chrome/browser/download/download_extensions.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_extensions.h
===================================================================
--- chrome/browser/download/download_extensions.h (revision 0)
+++ chrome/browser/download/download_extensions.h (revision 0)
@@ -0,0 +1,39 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSIONS_H_
+#define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSIONS_H_
+#pragma once
+
+#include <string>
+
+#include "base/file_path.h"
+
+namespace download_util {
+
+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);
+
+// 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);
+
+} // namespace download_util
+
+#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSIONS_H_
Property changes on: chrome/browser/download/download_extensions.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/download/download_exe.cc ('k') | chrome/browser/download/download_extensions.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698