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

Unified Diff: chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc

Issue 2911523002: Add metrics to printer setup flow. (Closed)
Patch Set: rebase Created 3 years, 7 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
« no previous file with comments | « chrome/browser/chromeos/printing/printer_configurer.h ('k') | chromeos/printing/printer_configuration.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc
diff --git a/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc b/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc
index 2d1181a17ed7e5521625ae97f6e861f751441f56..cd129cb619421eab66c8e77250b6b2785ebf2ca8 100644
--- a/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc
+++ b/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc
@@ -45,6 +45,14 @@ namespace settings {
namespace {
+// These values are written to logs. New enum values can be added, but existing
+// enums must never be renumbered or deleted and reused.
+enum PpdSourceForHistogram { kUser = 0, kScs = 1, kPpdSourceMax };
+
+void RecordPpdSource(const PpdSourceForHistogram& source) {
+ UMA_HISTOGRAM_ENUMERATION("Printing.CUPS.PpdSource", source, kPpdSourceMax);
+}
+
void OnRemovedPrinter(bool success) {}
std::unique_ptr<base::DictionaryValue> GetPrinterInfo(const Printer& printer) {
@@ -226,6 +234,7 @@ void CupsPrintersHandler::HandleAddCupsPrinter(const base::ListValue* args) {
// Verify a valid ppd path is present.
if (!printer_ppd_path.empty()) {
+ RecordPpdSource(kUser);
GURL tmp = net::FilePathToFileURL(base::FilePath(printer_ppd_path));
if (!tmp.is_valid()) {
LOG(ERROR) << "Invalid ppd path: " << printer_ppd_path;
@@ -234,6 +243,7 @@ void CupsPrintersHandler::HandleAddCupsPrinter(const base::ListValue* args) {
}
printer->mutable_ppd_reference()->user_supplied_ppd_url = tmp.spec();
} else if (!printer_manufacturer.empty() && !printer_model.empty()) {
+ RecordPpdSource(kScs);
// Using the manufacturer and model, get a ppd reference.
if (!ppd_provider_->GetPpdReference(printer_manufacturer, printer_model,
printer->mutable_ppd_reference())) {
@@ -256,6 +266,8 @@ void CupsPrintersHandler::OnAddedPrinter(
std::unique_ptr<Printer> printer,
chromeos::PrinterSetupResult result_code) {
std::string printer_name = printer->display_name();
+ UMA_HISTOGRAM_ENUMERATION("Printing.CUPS.PrinterSetupResult", result_code,
+ chromeos::PrinterSetupResult::kMaxValue);
switch (result_code) {
case chromeos::PrinterSetupResult::kSuccess: {
auto* manager = PrintersManagerFactory::GetForBrowserContext(profile_);
« no previous file with comments | « chrome/browser/chromeos/printing/printer_configurer.h ('k') | chromeos/printing/printer_configuration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698