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

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

Issue 2904243003: Add Printing.CUPS.PrintersDiscovered to our metrics. (Closed)
Patch Set: generalized comment 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
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 28a1781f5cad216bd1123cd274008f7d44ca2c0e..544005640147e0f46b4e3338220f0ab2fa84cb19 100644
--- a/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc
+++ b/chrome/browser/ui/webui/settings/chromeos/cups_printers_handler.cc
@@ -11,6 +11,7 @@
#include "base/files/file_util.h"
#include "base/json/json_string_value_serializer.h"
#include "base/memory/ptr_util.h"
+#include "base/metrics/histogram_macros.h"
#include "base/path_service.h"
#include "base/strings/string_util.h"
#include "base/threading/sequenced_task_runner_handle.h"
@@ -400,6 +401,7 @@ void CupsPrintersHandler::HandleStopDiscovery(const base::ListValue* args) {
}
void CupsPrintersHandler::OnPrintersFound(
+ bool scan_done,
const std::vector<Printer>& printers) {
std::unique_ptr<base::ListValue> printers_list =
base::MakeUnique<base::ListValue>();
@@ -408,10 +410,12 @@ void CupsPrintersHandler::OnPrintersFound(
}
FireWebUIListener("on-printer-discovered", *printers_list);
-}
-void CupsPrintersHandler::OnDiscoveryInitialScanDone() {
dpapad 2017/05/26 21:02:03 Is it necessary to merge OnDiscoveryInitialScanDon
skau 2017/05/26 21:20:10 Justin and I have been considering whether the cur
- FireWebUIListener("on-printer-discovery-done");
+ if (scan_done) {
+ UMA_HISTOGRAM_COUNTS_100("Printing.CUPS.PrintersDiscovered",
+ printers_list->GetSize());
+ FireWebUIListener("on-printer-discovery-done");
+ }
}
} // namespace settings

Powered by Google App Engine
This is Rietveld 408576698