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 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 // Helpers --------------------------------------------------------------------- | 131 // Helpers --------------------------------------------------------------------- |
132 | 132 |
133 // Creates a representation of a download in a format that the downloads | 133 // Creates a representation of a download in a format that the downloads |
134 // HTML page can understand. | 134 // HTML page can understand. |
135 base::DictionaryValue* CreateDownloadItemValue(content::DownloadItem* download, | 135 base::DictionaryValue* CreateDownloadItemValue(content::DownloadItem* download, |
136 int id); | 136 int id); |
137 | 137 |
138 // Get the localized status text for an in-progress download. | 138 // Get the localized status text for an in-progress download. |
139 string16 GetProgressStatusText(content::DownloadItem* download); | 139 string16 GetProgressStatusText(content::DownloadItem* download); |
140 | 140 |
141 // Update the application icon to indicate overall download progress. | |
142 // |download_count| is the number of downloads currently in progress. If | |
143 // |progress_known| is false, then at least one download is of indeterminate | |
144 // size and |progress| is invalid, otherwise |progress| indicates the overall | |
145 // download progress (float value from 0..1). | |
146 void UpdateAppIconDownloadProgress(int download_count, | |
147 bool progress_known, | |
148 float progress); | |
149 | |
150 // Returns a .crdownload intermediate path for the |suggested_path|. | 141 // Returns a .crdownload intermediate path for the |suggested_path|. |
151 FilePath GetCrDownloadPath(const FilePath& suggested_path); | 142 FilePath GetCrDownloadPath(const FilePath& suggested_path); |
152 | 143 |
153 // Check whether we can do the saving page operation for the specified URL. | 144 // Check whether we can do the saving page operation for the specified URL. |
154 bool IsSavableURL(const GURL& url); | 145 bool IsSavableURL(const GURL& url); |
155 | 146 |
156 // Record the total number of items and the number of in-progress items showing | 147 // Record the total number of items and the number of in-progress items showing |
157 // in the shelf when it closes. Set |autoclose| to true when the shelf is | 148 // in the shelf when it closes. Set |autoclose| to true when the shelf is |
158 // closing itself, false when the user explicitly closed it. | 149 // closing itself, false when the user explicitly closed it. |
159 void RecordShelfClose(int size, int in_progress, bool autoclose); | 150 void RecordShelfClose(int size, int in_progress, bool autoclose); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
198 | 189 |
199 // Increment one of the above counts. | 190 // Increment one of the above counts. |
200 void RecordDownloadCount(ChromeDownloadCountTypes type); | 191 void RecordDownloadCount(ChromeDownloadCountTypes type); |
201 | 192 |
202 // Record initiation of a download from a specific source. | 193 // Record initiation of a download from a specific source. |
203 void RecordDownloadSource(ChromeDownloadSource source); | 194 void RecordDownloadSource(ChromeDownloadSource source); |
204 | 195 |
205 } // namespace download_util | 196 } // namespace download_util |
206 | 197 |
207 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ | 198 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ |
OLD | NEW |