OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 17 matching lines...) Expand all Loading... |
28 class FilePath; | 28 class FilePath; |
29 class GURL; | 29 class GURL; |
30 class ResourceDispatcherHost; | 30 class ResourceDispatcherHost; |
31 class SkBitmap; | 31 class SkBitmap; |
32 class URLRequestContextGetter; | 32 class URLRequestContextGetter; |
33 | 33 |
34 struct DownloadSaveInfo; | 34 struct DownloadSaveInfo; |
35 | 35 |
36 namespace download_util { | 36 namespace download_util { |
37 | 37 |
38 // Download opening ------------------------------------------------------------ | |
39 | |
40 // Whether it is OK to open this download. | |
41 bool CanOpenDownload(DownloadItem* download); | |
42 | |
43 // Open the file associated with this download (wait for the download to | |
44 // complete if it is in progress). | |
45 void OpenDownload(DownloadItem* download); | |
46 | |
47 // Download temporary file creation -------------------------------------------- | 38 // Download temporary file creation -------------------------------------------- |
48 | 39 |
49 // Return the default download directory. | 40 // Return the default download directory. |
50 const FilePath& GetDefaultDownloadDirectory(); | 41 const FilePath& GetDefaultDownloadDirectory(); |
51 | 42 |
52 // Create a temporary file for a download in the user's default download | 43 // Create a temporary file for a download in the user's default download |
53 // directory and return true if was successful in creating the file. | 44 // directory and return true if was successful in creating the file. |
54 bool CreateTemporaryFileForDownload(FilePath* path); | 45 bool CreateTemporaryFileForDownload(FilePath* path); |
55 | 46 |
56 // Return true if the |download_path| is dangerous path. | 47 // Return true if the |download_path| is dangerous path. |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
184 // If |path| does not exist, 0 is returned. If it fails to find such | 175 // If |path| does not exist, 0 is returned. If it fails to find such |
185 // a number, -1 is returned. | 176 // a number, -1 is returned. |
186 int GetUniquePathNumberWithCrDownload(const FilePath& path); | 177 int GetUniquePathNumberWithCrDownload(const FilePath& path); |
187 | 178 |
188 // Returns a .crdownload intermediate path for the |suggested_path|. | 179 // Returns a .crdownload intermediate path for the |suggested_path|. |
189 FilePath GetCrDownloadPath(const FilePath& suggested_path); | 180 FilePath GetCrDownloadPath(const FilePath& suggested_path); |
190 | 181 |
191 } // namespace download_util | 182 } // namespace download_util |
192 | 183 |
193 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ | 184 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ |
OLD | NEW |