OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Download utilities. | 5 // Download utilities. |
6 | 6 |
7 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ | 7 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ |
8 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ | 8 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ |
9 #pragma once | 9 #pragma once |
10 | 10 |
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 // a number, -1 is returned. | 200 // a number, -1 is returned. |
201 int GetUniquePathNumberWithCrDownload(const FilePath& path); | 201 int GetUniquePathNumberWithCrDownload(const FilePath& path); |
202 | 202 |
203 // Erases all downloaded files with the specified path and name prefix. | 203 // Erases all downloaded files with the specified path and name prefix. |
204 // Used by download UI tests to clean up the download directory. | 204 // Used by download UI tests to clean up the download directory. |
205 void EraseUniqueDownloadFiles(const FilePath& path_prefix); | 205 void EraseUniqueDownloadFiles(const FilePath& path_prefix); |
206 | 206 |
207 // Returns a .crdownload intermediate path for the |suggested_path|. | 207 // Returns a .crdownload intermediate path for the |suggested_path|. |
208 FilePath GetCrDownloadPath(const FilePath& suggested_path); | 208 FilePath GetCrDownloadPath(const FilePath& suggested_path); |
209 | 209 |
210 // Whether a given download should be considered potentially dangerous. | 210 // Returns true if this download should show the "dangerous file" warning. |
211 bool IsDangerous(DownloadCreateInfo *info, Profile* profile); | 211 // Various factors are considered, such as the type of the file, whether a |
| 212 // user action initiated the download, and whether the user has explictly |
| 213 // marked the file type as "auto open". |
| 214 bool IsDangerous(DownloadCreateInfo* info, Profile* profile, bool auto_open); |
212 | 215 |
213 } // namespace download_util | 216 } // namespace download_util |
214 | 217 |
215 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ | 218 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ |
OLD | NEW |