| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSIONS_H_ | 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSIONS_H_ |
| 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSIONS_H_ | 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSIONS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/files/file_path.h" | 10 #include "base/files/file_path.h" |
| 11 | 11 |
| 12 namespace download_util { | 12 namespace download_util { |
| 13 | 13 |
| 14 enum DownloadDangerLevel { | 14 enum DownloadDangerLevel { |
| 15 NOT_DANGEROUS, | 15 NOT_DANGEROUS, |
| 16 ALLOW_ON_USER_GESTURE, | 16 ALLOW_ON_USER_GESTURE, |
| 17 DANGEROUS | 17 DANGEROUS |
| 18 }; | 18 }; |
| 19 | 19 |
| 20 // Determine the download danger level of a file. | 20 // Determine the download danger level of a file. |
| 21 DownloadDangerLevel GetFileDangerLevel(const base::FilePath& path); | 21 DownloadDangerLevel GetFileDangerLevel(const base::FilePath& path); |
| 22 | 22 |
| 23 // Returns true if the file specified by |path| is allowed to open |
| 24 // automatically. Most file types can be set to open automatically, but some |
| 25 // executable file types may not. |
| 26 bool IsAllowedToOpenAutomatically(const base::FilePath& path); |
| 27 |
| 23 // Tests if we think the server means for this mime_type to be executable. | 28 // Tests if we think the server means for this mime_type to be executable. |
| 24 bool IsExecutableMimeType(const std::string& mime_type); | 29 bool IsExecutableMimeType(const std::string& mime_type); |
| 25 | 30 |
| 26 } // namespace download_util | 31 } // namespace download_util |
| 27 | 32 |
| 28 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSIONS_H_ | 33 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_EXTENSIONS_H_ |
| OLD | NEW |