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

Unified Diff: chrome/browser/ui/webui/print_preview/print_preview_handler.cc

Issue 2597343002: Add a histogram to track the type of documents printed (HTML vs PDF) (Closed)
Patch Set: Reduce diff Created 4 years 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/print_preview/print_preview_handler.cc
diff --git a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
index 7a9693961a36b6508b956476611925a04a84758a..e46c52e7a43b7e6031e5cf32f1c3cff1e9453726 100644
--- a/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
+++ b/chrome/browser/ui/webui/print_preview/print_preview_handler.cc
@@ -145,6 +145,12 @@ enum PrintSettingsBuckets {
PRINT_SETTINGS_BUCKET_BOUNDARY
};
+enum PrintDocumentTypeBuckets {
Ilya Sherman 2016/12/28 23:25:53 Please document that this enum is used to back an
rbpotter 2016/12/28 23:57:29 Done. Made similar notes for the two enums above,
+ HTML_DOCUMENT = 0,
+ PDF_DOCUMENT,
+ PRINT_DOCUMENT_TYPE_BUCKET_BOUNDARY
+};
+
void ReportUserActionHistogram(enum UserActionBuckets event) {
UMA_HISTOGRAM_ENUMERATION("PrintPreview.UserAction", event,
USERACTION_BUCKET_BOUNDARY);
@@ -155,6 +161,11 @@ void ReportPrintSettingHistogram(enum PrintSettingsBuckets setting) {
PRINT_SETTINGS_BUCKET_BOUNDARY);
}
+void ReportPrintDocumentTypeHistogram(enum PrintDocumentTypeBuckets doctype) {
+ UMA_HISTOGRAM_ENUMERATION("PrintPreview.PrintDocumentType", doctype,
+ PRINT_DOCUMENT_TYPE_BUCKET_BOUNDARY);
+}
+
// Name of a dictionary field holding cloud print related data;
const char kAppState[] = "appState";
// Name of a dictionary field holding the initiator title.
@@ -804,6 +815,10 @@ void PrintPreviewHandler::HandlePrint(const base::ListValue* args) {
ReportPrintSettingsStats(*settings);
+ // Report whether the user printed a PDF or an HTML document.
+ ReportPrintDocumentTypeHistogram(print_preview_ui()->source_is_modifiable() ?
+ HTML_DOCUMENT : PDF_DOCUMENT);
+
// Never try to add headers/footers here. It's already in the generated PDF.
settings->SetBoolean(printing::kSettingHeaderFooterEnabled, false);
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | tools/metrics/histograms/histograms.xml » ('J')

Powered by Google App Engine
This is Rietveld 408576698