summaryrefslogtreecommitdiffstats
path: root/chrome/browser/download/download_util.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/download/download_util.h')
-rw-r--r--chrome/browser/download/download_util.h39
1 files changed, 39 insertions, 0 deletions
diff --git a/chrome/browser/download/download_util.h b/chrome/browser/download/download_util.h
index 8edf1ea..170b05c 100644
--- a/chrome/browser/download/download_util.h
+++ b/chrome/browser/download/download_util.h
@@ -118,6 +118,45 @@ enum PaintDownloadProgressSize {
BIG
};
+// We keep a count of how often various events occur in the
+// histogram "Download.Counts".
+enum DownloadCountTypes {
+ // The download was initiated by navigating to a URL (e.g. by user
+ // click).
+ INITIATED_BY_NAVIGATION_COUNT = 0,
+
+ // The download was initiated by invoking a context menu within a page.
+ INITIATED_BY_CONTEXT_MENU_COUNT,
+
+ // The download was initiated when the SavePackage system rejected
+ // a Save Page As ... by returning false from
+ // SavePackage::IsSaveableContents().
+ INITIATED_BY_SAVE_PACKAGE_FAILURE_COUNT,
+
+ // The download was initiated by a drag and drop from a drag-and-drop
+ // enabled web application.
+ INITIATED_BY_DRAG_N_DROP_COUNT,
+
+ // The download was initiated by explicit RPC from the renderer process
+ // (e.g. by Alt-click).
+ INITIATED_BY_RENDERER_COUNT,
+
+ // Downloads that made it to DownloadResourceHandler -- all of the
+ // above minus those blocked by DownloadThrottlingResourceHandler.
+ UNTHROTTLED_COUNT,
+
+ // Downloads that actually complete.
+ COMPLETED_COUNT,
+
+ // Downloads that are cancelled before completion (user action or error).
+ CANCELLED_COUNT,
+
+ DOWNLOAD_COUNT_TYPES_LAST_ENTRY
+};
+
+// Increment one of the above counts.
+void RecordDownloadCount(DownloadCountTypes type);
+
// Paint the common download animation progress foreground and background,
// clipping the foreground to 'percent' full. If percent is -1, then we don't
// know the total size, so we just draw a rotating segment until we're done.