Index: chromeos/printing/fake_printer_discoverer.h |
diff --git a/chromeos/printing/fake_printer_discoverer.h b/chromeos/printing/fake_printer_discoverer.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bbc61bb53b080b7184b4832ee44834a6f55d0c23 |
--- /dev/null |
+++ b/chromeos/printing/fake_printer_discoverer.h |
@@ -0,0 +1,41 @@ |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROMEOS_PRINTING_FAKE_PRINTER_DISCOVERER_H_ |
+#define CHROMEOS_PRINTING_FAKE_PRINTER_DISCOVERER_H_ |
+ |
+#include <vector> |
+ |
+#include "base/macros.h" |
+#include "base/memory/weak_ptr.h" |
+#include "chromeos/printing/printer_configuration.h" |
+#include "chromeos/printing/printer_discoverer.h" |
+ |
+namespace chromeos { |
+ |
+class FakePrinterDiscoverer : public PrinterDiscoverer { |
+ public: |
+ FakePrinterDiscoverer(); |
+ ~FakePrinterDiscoverer(); |
+ |
+ bool StartDiscovery() override; |
+ bool StopDiscovery() override; |
+ void AddObserver(PrinterDiscoverer::Observer* observer) override; |
+ void RemoveObserver(PrinterDiscoverer::Observer* observer) override; |
+ |
+ private: |
+ void EmitPrinters(size_t start, size_t end); |
+ |
+ std::vector<chromeos::Printer> printers_; |
+ bool discovery_running_; |
+ std::vector<PrinterDiscoverer::Observer*> observers_; |
+ |
+ base::WeakPtrFactory<FakePrinterDiscoverer> weak_ptr_factory_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(FakePrinterDiscoverer); |
+}; |
+ |
+} // namespace chromeos |
+ |
+#endif // CHROMEOS_PRINTING_FAKE_PRINTER_DISCOVERER_H_ |