| 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 bool IsSavableURL(const GURL& url); | 167 bool IsSavableURL(const GURL& url); |
| 168 | 168 |
| 169 // Record the total number of items and the number of in-progress items showing | 169 // Record the total number of items and the number of in-progress items showing |
| 170 // in the shelf when it closes. Set |autoclose| to true when the shelf is | 170 // in the shelf when it closes. Set |autoclose| to true when the shelf is |
| 171 // closing itself, false when the user explicitly closed it. | 171 // closing itself, false when the user explicitly closed it. |
| 172 void RecordShelfClose(int size, int in_progress, bool autoclose); | 172 void RecordShelfClose(int size, int in_progress, bool autoclose); |
| 173 | 173 |
| 174 // Used for counting UMA stats. Similar to content's | 174 // Used for counting UMA stats. Similar to content's |
| 175 // download_stats::DownloadCountTypes but from the chrome layer. | 175 // download_stats::DownloadCountTypes but from the chrome layer. |
| 176 enum ChromeDownloadCountTypes { | 176 enum ChromeDownloadCountTypes { |
| 177 // A download *would* have been initiated, but it was blocked |
| 178 // by the DownloadThrottlingResourceHandler. |
| 179 BLOCKED_BY_THROTTLING = 0, |
| 180 |
| 181 CHROME_DOWNLOAD_COUNT_TYPES_LAST_ENTRY |
| 182 }; |
| 183 |
| 184 // Used for counting UMA stats. Similar to content's |
| 185 // download_stats::DownloadInitiattionSources but from the chrome layer. |
| 186 enum ChromeDownloadSource { |
| 177 // The download was initiated by navigating to a URL (e.g. by user click). | 187 // The download was initiated by navigating to a URL (e.g. by user click). |
| 178 INITIATED_BY_NAVIGATION_COUNT = 0, | 188 INITIATED_BY_NAVIGATION = 0, |
| 179 | 189 |
| 180 // The download was initiated by invoking a context menu within a page. | 190 // The download was initiated by invoking a context menu within a page. |
| 181 INITIATED_BY_CONTEXT_MENU_COUNT, | 191 INITIATED_BY_CONTEXT_MENU, |
| 182 | 192 |
| 183 // The download was initiated by the WebStore installer. | 193 // The download was initiated by the WebStore installer. |
| 184 INITIATED_BY_WEBSTORE_INSTALLER_COUNT, | 194 INITIATED_BY_WEBSTORE_INSTALLER, |
| 185 | 195 |
| 186 // The download was initiated by the ImageBurner (cros). | 196 // The download was initiated by the ImageBurner (cros). |
| 187 INITIATED_BY_IMAGE_BURNER_COUNT, | 197 INITIATED_BY_IMAGE_BURNER, |
| 188 | 198 |
| 189 DOWNLOAD_COUNT_TYPES_LAST_ENTRY, | 199 // The download was initiated by the plugin installer. |
| 200 INITIATED_BY_PLUGIN_INSTALLER, |
| 201 |
| 202 CHROME_DOWNLOAD_SOURCE_LAST_ENTRY, |
| 190 }; | 203 }; |
| 191 | 204 |
| 205 // Increment one of the above counts. |
| 192 void RecordDownloadCount(ChromeDownloadCountTypes type); | 206 void RecordDownloadCount(ChromeDownloadCountTypes type); |
| 193 | 207 |
| 208 // Record initiation of a download from a specific source. |
| 209 void RecordDownloadSource(ChromeDownloadSource source); |
| 210 |
| 194 } // namespace download_util | 211 } // namespace download_util |
| 195 | 212 |
| 196 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ | 213 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_ |
| OLD | NEW |