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

Unified Diff: chrome/browser/chromeos/printing/printer_discoverer.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/chromeos/printing/printer_discoverer.cc
diff --git a/chrome/browser/chromeos/printing/printer_discoverer.cc b/chrome/browser/chromeos/printing/printer_discoverer.cc
index e6f91591cd6080de08144e1cabeaae076bc3bf26..85f405a623841be2d6fe23a1c0192194d8c7de34 100644
--- a/chrome/browser/chromeos/printing/printer_discoverer.cc
+++ b/chrome/browser/chromeos/printing/printer_discoverer.cc
@@ -59,7 +59,8 @@ class PrinterDiscovererImpl : public PrinterDiscoverer,
usb_printers_ = printers;
std::vector<Printer> all_printers = GetAvailablePrinters();
for (PrinterDiscoverer::Observer& observer : observer_list_) {
- observer.OnPrintersFound(all_printers);
+ // We get all USB printers the first time so the scan is completed.
+ observer.OnPrintersFound(true /*scan_done*/, all_printers);
dpapad 2017/05/26 21:02:03 When is OnPrintersFound called with |false|? I don
skau 2017/05/26 21:20:10 It's not called with false right now. The interfa
}
}
@@ -69,13 +70,12 @@ class PrinterDiscovererImpl : public PrinterDiscoverer,
void WrappedOnPrintersFound(PrinterDiscoverer::Observer* observer,
const std::vector<Printer>& printers) {
if (observer_list_.HasObserver(observer)) {
- observer->OnPrintersFound(printers);
// Since USB is the only thing we're worried about at the moment, and we
// don't have to wait for those printers to be scanned, we can just tell
// the observer the initial scan is done now. This will change when we're
// also doing network discovery -- we'll hold off on issuing this callback
// until the network discovery is done as well.
- observer->OnDiscoveryInitialScanDone();
+ observer->OnPrintersFound(true, printers);
}
}

Powered by Google App Engine
This is Rietveld 408576698