| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 class DictionaryValue; | 25 class DictionaryValue; |
| 26 } | 26 } |
| 27 | 27 |
| 28 namespace content { | 28 namespace content { |
| 29 class DownloadItem; | 29 class DownloadItem; |
| 30 } | 30 } |
| 31 | 31 |
| 32 namespace gfx { | 32 namespace gfx { |
| 33 class Canvas; | 33 class Canvas; |
| 34 class Image; | 34 class Image; |
| 35 class ImageSkia; |
| 36 class Rect; |
| 35 } | 37 } |
| 36 | 38 |
| 37 namespace download_util { | 39 namespace download_util { |
| 38 | 40 |
| 39 // Download temporary file creation -------------------------------------------- | 41 // Download temporary file creation -------------------------------------------- |
| 40 | 42 |
| 41 // Return the default download directory. | 43 // Return the default download directory. |
| 42 const FilePath& GetDefaultDownloadDirectory(); | 44 const FilePath& GetDefaultDownloadDirectory(); |
| 43 | 45 |
| 44 // Return true if the |download_path| is dangerous path. | 46 // Return true if the |download_path| is dangerous path. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 86 |
| 85 // Paint the common download animation progress foreground and background, | 87 // Paint the common download animation progress foreground and background, |
| 86 // clipping the foreground to 'percent' full. If percent is -1, then we don't | 88 // clipping the foreground to 'percent' full. If percent is -1, then we don't |
| 87 // know the total size, so we just draw a rotating segment until we're done. | 89 // know the total size, so we just draw a rotating segment until we're done. |
| 88 // | 90 // |
| 89 // |containing_view| is the View subclass within which the progress animation | 91 // |containing_view| is the View subclass within which the progress animation |
| 90 // is drawn (generally either DownloadItemTabView or DownloadItemView). We | 92 // is drawn (generally either DownloadItemTabView or DownloadItemView). We |
| 91 // require the containing View in addition to the canvas because if we are | 93 // require the containing View in addition to the canvas because if we are |
| 92 // drawing in a right-to-left locale, we need to mirror the position of the | 94 // drawing in a right-to-left locale, we need to mirror the position of the |
| 93 // progress animation within the containing View. | 95 // progress animation within the containing View. |
| 96 void PaintCustomDownloadProgress(gfx::Canvas* canvas, |
| 97 const gfx::ImageSkia& background_image, |
| 98 const gfx::ImageSkia& foreground_image, |
| 99 int image_size, |
| 100 const gfx::Rect& bounds, |
| 101 int start_angle, |
| 102 int percent_done); |
| 103 |
| 94 void PaintDownloadProgress(gfx::Canvas* canvas, | 104 void PaintDownloadProgress(gfx::Canvas* canvas, |
| 95 #if defined(TOOLKIT_VIEWS) | 105 #if defined(TOOLKIT_VIEWS) |
| 96 views::View* containing_view, | 106 views::View* containing_view, |
| 97 #endif | 107 #endif |
| 98 int origin_x, | 108 int origin_x, |
| 99 int origin_y, | 109 int origin_y, |
| 100 int start_angle, | 110 int start_angle, |
| 101 int percent, | 111 int percent, |
| 102 PaintDownloadProgressSize size); | 112 PaintDownloadProgressSize size); |
| 103 | 113 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 | 194 |
| 185 // Increment one of the above counts. | 195 // Increment one of the above counts. |
| 186 void RecordDownloadCount(ChromeDownloadCountTypes type); | 196 void RecordDownloadCount(ChromeDownloadCountTypes type); |
| 187 | 197 |
| 188 // Record initiation of a download from a specific source. | 198 // Record initiation of a download from a specific source. |
| 189 void RecordDownloadSource(ChromeDownloadSource source); | 199 void RecordDownloadSource(ChromeDownloadSource source); |
| 190 | 200 |
| 191 } // namespace download_util | 201 } // namespace download_util |
| 192 | 202 |
| 193 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ | 203 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ |
| OLD | NEW |