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

Unified Diff: chrome/browser/chromeos/printing/usb_printer_detector.h

Issue 2945303005: Refactor PrinterDiscoverer and PrinterDetector to use a common interface. (Closed)
Patch Set: Created 3 years, 6 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/usb_printer_detector.h
diff --git a/chrome/browser/chromeos/printing/usb_printer_detector.h b/chrome/browser/chromeos/printing/usb_printer_detector.h
index 1e5c9d9f48e8f1a0659b9c2eddf7c3d4f65bcd4d..3482ab97c71565c41fa97605eeb5e65d02780dae 100644
--- a/chrome/browser/chromeos/printing/usb_printer_detector.h
+++ b/chrome/browser/chromeos/printing/usb_printer_detector.h
@@ -10,6 +10,7 @@
#include <vector>
#include "base/macros.h"
+#include "chrome/browser/chromeos/printing/printer_detector.h"
#include "chromeos/printing/printer_configuration.h"
#include "components/keyed_service/core/keyed_service.h"
@@ -17,30 +18,17 @@ class Profile;
namespace chromeos {
-// Observes device::UsbService for addition of USB printers (devices with
-// interface class 7). When a device is detected, it is forwarded to the
-// printing subsystem for either autoconfiguration or user guidance.
-class UsbPrinterDetector : public KeyedService {
+// Observes device::UsbService for addition of USB printers. When a new USB
+// printer that is not already configured for this user is found, if it can be
+// automatically configured for printing, that is done. USB printers that
+// cannot be automatically configured are exposed via the PrinterDetector
+// interface so that higher level processing can handle them.
+class UsbPrinterDetector : public PrinterDetector, public KeyedService {
public:
- class Observer {
- public:
- virtual ~Observer() = default;
-
- // The set of available printers has changed.
- virtual void OnAvailableUsbPrintersChanged(
- const std::vector<Printer>& printers) = 0;
- };
-
// Factory function for the CUPS implementation.
static std::unique_ptr<UsbPrinterDetector> Create(Profile* profile);
~UsbPrinterDetector() override = default;
- virtual void AddObserver(Observer* observer) = 0;
- virtual void RemoveObserver(Observer* observer) = 0;
-
- // Get the current set of detected printers.
- virtual std::vector<Printer> GetPrinters() = 0;
-
protected:
UsbPrinterDetector() = default;
« no previous file with comments | « chrome/browser/chromeos/printing/printer_detector.h ('k') | chrome/browser/chromeos/printing/usb_printer_detector.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698