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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 | 167 |
168 // Increment one of the above counts. | 168 // Increment one of the above counts. |
169 void RecordDownloadCount(DownloadCountTypes type); | 169 void RecordDownloadCount(DownloadCountTypes type); |
170 | 170 |
171 // Record COMPLETED_COUNT and how long the download took. | 171 // Record COMPLETED_COUNT and how long the download took. |
172 void RecordDownloadCompleted(const base::TimeTicks& start); | 172 void RecordDownloadCompleted(const base::TimeTicks& start); |
173 | 173 |
174 // Record INTERRUPTED_COUNT, |error|, |received| and |total| bytes. | 174 // Record INTERRUPTED_COUNT, |error|, |received| and |total| bytes. |
175 void RecordDownloadInterrupted(int error, int64 received, int64 total); | 175 void RecordDownloadInterrupted(int error, int64 received, int64 total); |
176 | 176 |
| 177 // Records the mime type of the download. |
| 178 void RecordDownloadMimeType(const std::string& mime_type); |
| 179 |
177 // Paint the common download animation progress foreground and background, | 180 // Paint the common download animation progress foreground and background, |
178 // clipping the foreground to 'percent' full. If percent is -1, then we don't | 181 // clipping the foreground to 'percent' full. If percent is -1, then we don't |
179 // know the total size, so we just draw a rotating segment until we're done. | 182 // know the total size, so we just draw a rotating segment until we're done. |
180 // | 183 // |
181 // |containing_view| is the View subclass within which the progress animation | 184 // |containing_view| is the View subclass within which the progress animation |
182 // is drawn (generally either DownloadItemTabView or DownloadItemView). We | 185 // is drawn (generally either DownloadItemTabView or DownloadItemView). We |
183 // require the containing View in addition to the canvas because if we are | 186 // require the containing View in addition to the canvas because if we are |
184 // drawing in a right-to-left locale, we need to mirror the position of the | 187 // drawing in a right-to-left locale, we need to mirror the position of the |
185 // progress animation within the containing View. | 188 // progress animation within the containing View. |
186 void PaintDownloadProgress(gfx::Canvas* canvas, | 189 void PaintDownloadProgress(gfx::Canvas* canvas, |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 // Erases all downloaded files with the specified path and name prefix. | 273 // Erases all downloaded files with the specified path and name prefix. |
271 // Used by download UI tests to clean up the download directory. | 274 // Used by download UI tests to clean up the download directory. |
272 void EraseUniqueDownloadFiles(const FilePath& path_prefix); | 275 void EraseUniqueDownloadFiles(const FilePath& path_prefix); |
273 | 276 |
274 // Returns a .crdownload intermediate path for the |suggested_path|. | 277 // Returns a .crdownload intermediate path for the |suggested_path|. |
275 FilePath GetCrDownloadPath(const FilePath& suggested_path); | 278 FilePath GetCrDownloadPath(const FilePath& suggested_path); |
276 | 279 |
277 } // namespace download_util | 280 } // namespace download_util |
278 | 281 |
279 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ | 282 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ |
OLD | NEW |