OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROMEOS_PRINTING_FAKE_PRINTER_DETECTOR_H_ |
| 6 #define CHROMEOS_PRINTING_FAKE_PRINTER_DETECTOR_H_ |
| 7 |
| 8 #include <vector> |
| 9 |
| 10 #include "base/macros.h" |
| 11 #include "base/memory/weak_ptr.h" |
| 12 #include "chromeos/printing/printer_configuration.h" |
| 13 #include "chromeos/printing/printer_detector.h" |
| 14 |
| 15 namespace chromeos { |
| 16 |
| 17 class FakePrinterDetector : public PrinterDetector { |
| 18 public: |
| 19 FakePrinterDetector(); |
| 20 ~FakePrinterDetector(); |
| 21 |
| 22 bool StartDiscovery() override; |
| 23 bool StopDiscovery() override; |
| 24 void AddObserver(PrinterDetector::Observer* observer) override; |
| 25 void RemoveObserver(PrinterDetector::Observer* observer) override; |
| 26 |
| 27 private: |
| 28 void EmitPrinters(size_t start, size_t end); |
| 29 |
| 30 std::vector<chromeos::Printer> printers_; |
| 31 bool discovery_running_; |
| 32 std::vector<PrinterDetector::Observer*> observers_; |
| 33 |
| 34 base::WeakPtrFactory<FakePrinterDetector> weak_ptr_factory_; |
| 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(FakePrinterDetector); |
| 37 }; |
| 38 |
| 39 } // namespace chromeos |
| 40 |
| 41 #endif // CHROMEOS_PRINTING_FAKE_PRINTER_DETECTOR_H_ |
OLD | NEW |