| 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 #pragma once | 9 #pragma once |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 namespace base { | 25 namespace base { |
| 26 class DictionaryValue; | 26 class DictionaryValue; |
| 27 } | 27 } |
| 28 | 28 |
| 29 namespace content { | 29 namespace content { |
| 30 class DownloadItem; | 30 class DownloadItem; |
| 31 } | 31 } |
| 32 | 32 |
| 33 namespace gfx { | 33 namespace gfx { |
| 34 class Canvas; | 34 class CanvasSkia; |
| 35 class Image; | 35 class Image; |
| 36 } | 36 } |
| 37 | 37 |
| 38 namespace download_util { | 38 namespace download_util { |
| 39 | 39 |
| 40 // Download temporary file creation -------------------------------------------- | 40 // Download temporary file creation -------------------------------------------- |
| 41 | 41 |
| 42 // Return the default download directory. | 42 // Return the default download directory. |
| 43 const FilePath& GetDefaultDownloadDirectory(); | 43 const FilePath& GetDefaultDownloadDirectory(); |
| 44 | 44 |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 | 91 |
| 92 // Paint the common download animation progress foreground and background, | 92 // Paint the common download animation progress foreground and background, |
| 93 // clipping the foreground to 'percent' full. If percent is -1, then we don't | 93 // clipping the foreground to 'percent' full. If percent is -1, then we don't |
| 94 // know the total size, so we just draw a rotating segment until we're done. | 94 // know the total size, so we just draw a rotating segment until we're done. |
| 95 // | 95 // |
| 96 // |containing_view| is the View subclass within which the progress animation | 96 // |containing_view| is the View subclass within which the progress animation |
| 97 // is drawn (generally either DownloadItemTabView or DownloadItemView). We | 97 // is drawn (generally either DownloadItemTabView or DownloadItemView). We |
| 98 // require the containing View in addition to the canvas because if we are | 98 // require the containing View in addition to the canvas because if we are |
| 99 // drawing in a right-to-left locale, we need to mirror the position of the | 99 // drawing in a right-to-left locale, we need to mirror the position of the |
| 100 // progress animation within the containing View. | 100 // progress animation within the containing View. |
| 101 void PaintDownloadProgress(gfx::Canvas* canvas, | 101 void PaintDownloadProgress(gfx::CanvasSkia* canvas, |
| 102 #if defined(TOOLKIT_VIEWS) | 102 #if defined(TOOLKIT_VIEWS) |
| 103 views::View* containing_view, | 103 views::View* containing_view, |
| 104 #endif | 104 #endif |
| 105 int origin_x, | 105 int origin_x, |
| 106 int origin_y, | 106 int origin_y, |
| 107 int start_angle, | 107 int start_angle, |
| 108 int percent, | 108 int percent, |
| 109 PaintDownloadProgressSize size); | 109 PaintDownloadProgressSize size); |
| 110 | 110 |
| 111 void PaintDownloadComplete(gfx::Canvas* canvas, | 111 void PaintDownloadComplete(gfx::CanvasSkia* canvas, |
| 112 #if defined(TOOLKIT_VIEWS) | 112 #if defined(TOOLKIT_VIEWS) |
| 113 views::View* containing_view, | 113 views::View* containing_view, |
| 114 #endif | 114 #endif |
| 115 int origin_x, | 115 int origin_x, |
| 116 int origin_y, | 116 int origin_y, |
| 117 double animation_progress, | 117 double animation_progress, |
| 118 PaintDownloadProgressSize size); | 118 PaintDownloadProgressSize size); |
| 119 | 119 |
| 120 void PaintDownloadInterrupted(gfx::Canvas* canvas, | 120 void PaintDownloadInterrupted(gfx::CanvasSkia* canvas, |
| 121 #if defined(TOOLKIT_VIEWS) | 121 #if defined(TOOLKIT_VIEWS) |
| 122 views::View* containing_view, | 122 views::View* containing_view, |
| 123 #endif | 123 #endif |
| 124 int origin_x, | 124 int origin_x, |
| 125 int origin_y, | 125 int origin_y, |
| 126 double animation_progress, | 126 double animation_progress, |
| 127 PaintDownloadProgressSize size); | 127 PaintDownloadProgressSize size); |
| 128 | 128 |
| 129 // Drag support ---------------------------------------------------------------- | 129 // Drag support ---------------------------------------------------------------- |
| 130 | 130 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 211 | 211 |
| 212 // Increment one of the above counts. | 212 // Increment one of the above counts. |
| 213 void RecordDownloadCount(ChromeDownloadCountTypes type); | 213 void RecordDownloadCount(ChromeDownloadCountTypes type); |
| 214 | 214 |
| 215 // Record initiation of a download from a specific source. | 215 // Record initiation of a download from a specific source. |
| 216 void RecordDownloadSource(ChromeDownloadSource source); | 216 void RecordDownloadSource(ChromeDownloadSource source); |
| 217 | 217 |
| 218 } // namespace download_util | 218 } // namespace download_util |
| 219 | 219 |
| 220 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ | 220 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ |
| OLD | NEW |