Index: chrome/browser/chromeos/printer_detector/printer_detector.h |
diff --git a/chrome/browser/chromeos/printer_detector/printer_detector.h b/chrome/browser/chromeos/printer_detector/printer_detector.h |
index e7a5b3d5828d89b36b25bbf817639688f68f11d0..a5d2bf59098e542b7d70a13af1135b98b4f2b556 100644 |
--- a/chrome/browser/chromeos/printer_detector/printer_detector.h |
+++ b/chrome/browser/chromeos/printer_detector/printer_detector.h |
@@ -7,8 +7,11 @@ |
#include <memory> |
#include <string> |
+#include <vector> |
#include "base/macros.h" |
+#include "base/memory/ref_counted.h" |
stevenjb
2017/04/10 19:49:55
needed?
Carlson
2017/04/10 22:16:41
Removed
|
+#include "chromeos/printing/printer_configuration.h" |
#include "components/keyed_service/core/keyed_service.h" |
class NotificationUIManager; |
@@ -34,6 +37,15 @@ namespace chromeos { |
// CUPS backend. |
class PrinterDetector : public KeyedService { |
public: |
+ class Observer { |
+ public: |
+ virtual ~Observer() = default; |
+ |
+ // The set of available printers has changed |
stevenjb
2017/04/10 19:49:55
nit: .
Carlson
2017/04/10 22:16:41
Done.
|
+ virtual void OnAvailableUsbPrintersChanged( |
+ const std::vector<Printer>& printers) = 0; |
+ }; |
+ |
// Factory function for the Legacy implementation. |
static std::unique_ptr<PrinterDetector> CreateLegacy(Profile* profile); |
@@ -41,6 +53,13 @@ class PrinterDetector : public KeyedService { |
static std::unique_ptr<PrinterDetector> CreateCups(Profile* profile); |
~PrinterDetector() override {} |
+ // Observer management. Note these are only implemented for the cups backend. |
+ virtual void AddObserver(Observer* observer) {} |
+ virtual void RemoveObserver(Observer* observer) {} |
+ |
+ // Get the current set of detected printers. |
+ virtual std::vector<Printer> GetPrinters() { return {}; } |
+ |
protected: |
PrinterDetector() = default; |