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); |