| 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 // 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 // Return true if the |download_path| is dangerous path. | 55 // Return true if the |download_path| is dangerous path. |
| 56 bool DownloadPathIsDangerous(const FilePath& download_path); | 56 bool DownloadPathIsDangerous(const FilePath& download_path); |
| 57 | 57 |
| 58 // Generate a filename based on the response from the server. Similar | 58 // Generate a filename based on the response from the server. Similar |
| 59 // in operation to net::GenerateFileName(), but uses a localized | 59 // in operation to net::GenerateFileName(), but uses a localized |
| 60 // default name. | 60 // default name. |
| 61 void GenerateFileNameFromRequest(const DownloadItem& download_item, | 61 void GenerateFileNameFromRequest(const DownloadItem& download_item, |
| 62 FilePath* generated_name); | 62 FilePath* generated_name); |
| 63 | 63 |
| 64 // Generate a filename based on the URL, a suggested name and a MIME | |
| 65 // type. Similar in operation to net::GenerateFileName(), but uses a | |
| 66 // localized default name. | |
| 67 void GenerateFileNameFromSuggestedName(const GURL& url, | |
| 68 const std::string& suggested_name, | |
| 69 const std::string& mime_type, | |
| 70 FilePath* generated_name); | |
| 71 | |
| 72 // Download progress animations ------------------------------------------------ | 64 // Download progress animations ------------------------------------------------ |
| 73 | 65 |
| 74 // Arc sweep angle for use with downloads of unknown size | 66 // Arc sweep angle for use with downloads of unknown size |
| 75 const int kUnknownAngleDegrees = 50; | 67 const int kUnknownAngleDegrees = 50; |
| 76 | 68 |
| 77 // Rate of progress for use with downloads of unknown size | 69 // Rate of progress for use with downloads of unknown size |
| 78 const int kUnknownIncrementDegrees = 12; | 70 const int kUnknownIncrementDegrees = 12; |
| 79 | 71 |
| 80 // Start angle for downloads with known size (midnight position) | 72 // Start angle for downloads with known size (midnight position) |
| 81 const int kStartAngleDegrees = -90; | 73 const int kStartAngleDegrees = -90; |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 // If |path| does not exist, 0 is returned. If it fails to find such | 168 // If |path| does not exist, 0 is returned. If it fails to find such |
| 177 // a number, -1 is returned. | 169 // a number, -1 is returned. |
| 178 int GetUniquePathNumberWithCrDownload(const FilePath& path); | 170 int GetUniquePathNumberWithCrDownload(const FilePath& path); |
| 179 | 171 |
| 180 // Returns a .crdownload intermediate path for the |suggested_path|. | 172 // Returns a .crdownload intermediate path for the |suggested_path|. |
| 181 FilePath GetCrDownloadPath(const FilePath& suggested_path); | 173 FilePath GetCrDownloadPath(const FilePath& suggested_path); |
| 182 | 174 |
| 183 } // namespace download_util | 175 } // namespace download_util |
| 184 | 176 |
| 185 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ | 177 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ |
| OLD | NEW |