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

Unified Diff: content/browser/download/download_stats.cc

Issue 2758453003: Recording download mime types for normal profile (Closed)
Patch Set: Created 3 years, 9 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: content/browser/download/download_stats.cc
diff --git a/content/browser/download/download_stats.cc b/content/browser/download/download_stats.cc
index 87fbe199defcee2e36592a7e527d14245328ec72..b28fffc85112079d04c6165daf5ef7f47b9e5a55 100644
--- a/content/browser/download/download_stats.cc
+++ b/content/browser/download/download_stats.cc
@@ -583,9 +583,8 @@ void RecordDownloadImageType(const std::string& mime_type_string) {
DOWNLOAD_IMAGE_MAX);
}
-} // namespace
-
-void RecordDownloadMimeType(const std::string& mime_type_string) {
+DownloadContent DownloadContentTypeFromMimeType(
+ const std::string& mime_type_string) {
DownloadContent download_content = DOWNLOAD_CONTENT_UNRECOGNIZED;
// Look up exact matches.
@@ -615,12 +614,30 @@ void RecordDownloadMimeType(const std::string& mime_type_string) {
}
}
+ return download_content;
+}
+
+} // namespace
+
+void RecordDownloadMimeType(const std::string& mime_type_string) {
+ DownloadContent download_content =
+ DownloadContentTypeFromMimeType(mime_type_string);
+
// Record the value.
- UMA_HISTOGRAM_ENUMERATION("Download.ContentType",
- download_content,
+ UMA_HISTOGRAM_ENUMERATION("Download.ContentType", download_content,
DOWNLOAD_CONTENT_MAX);
}
+void RecordDownloadMimeTypeForNormalProfile(
+ const std::string& mime_type_string) {
+ DownloadContent download_content =
+ DownloadContentTypeFromMimeType(mime_type_string);
+
+ // Record the value.
+ UMA_HISTOGRAM_ENUMERATION("Download.ContentType.NonOffTheRecord",
+ download_content, DOWNLOAD_CONTENT_MAX);
+}
+
void RecordDownloadContentDisposition(
const std::string& content_disposition_string) {
if (content_disposition_string.empty())

Powered by Google App Engine
This is Rietveld 408576698