Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1273)

Unified Diff: chrome/browser/download/download_util.h

Issue 9316116: Isolate initiation counts for downloads to their own histograms and improve (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Restored curlies to original. Created 8 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/download/download_util.h
diff --git a/chrome/browser/download/download_util.h b/chrome/browser/download/download_util.h
index 6df96e46bce3154890153569f2d26c8d227da0f9..23c1d9c7e50f1cbc31dbb00eb1f6bf8987cc4e3c 100644
--- a/chrome/browser/download/download_util.h
+++ b/chrome/browser/download/download_util.h
@@ -174,23 +174,40 @@ void RecordShelfClose(int size, int in_progress, bool autoclose);
// Used for counting UMA stats. Similar to content's
// download_stats::DownloadCountTypes but from the chrome layer.
enum ChromeDownloadCountTypes {
+ // A download *would* have been initiated, but it was blocked
+ // by the DownloadThrottlingResourceHandler.
+ BLOCKED_BY_THROTTLING = 0,
+
+ CHROME_DOWNLOAD_COUNT_TYPES_LAST_ENTRY
+};
+
+// Used for counting UMA stats. Similar to content's
+// download_stats::DownloadInitiattionSources but from the chrome layer.
+enum ChromeDownloadSource {
// The download was initiated by navigating to a URL (e.g. by user click).
- INITIATED_BY_NAVIGATION_COUNT = 0,
+ INITIATED_BY_NAVIGATION = 0,
// The download was initiated by invoking a context menu within a page.
- INITIATED_BY_CONTEXT_MENU_COUNT,
+ INITIATED_BY_CONTEXT_MENU,
// The download was initiated by the WebStore installer.
- INITIATED_BY_WEBSTORE_INSTALLER_COUNT,
+ INITIATED_BY_WEBSTORE_INSTALLER,
// The download was initiated by the ImageBurner (cros).
- INITIATED_BY_IMAGE_BURNER_COUNT,
+ INITIATED_BY_IMAGE_BURNER,
+
+ // The download was initiated by the plugin installer.
+ INITIATED_BY_PLUGIN_INSTALLER,
- DOWNLOAD_COUNT_TYPES_LAST_ENTRY,
+ CHROME_DOWNLOAD_SOURCE_LAST_ENTRY,
};
+// Increment one of the above counts.
void RecordDownloadCount(ChromeDownloadCountTypes type);
+// Record initiation of a download from a specific source.
+void RecordDownloadSource(ChromeDownloadSource source);
+
} // namespace download_util
#endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_UTIL_H_

Powered by Google App Engine
This is Rietveld 408576698