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 CHROME_BROWSER_CHROMEOS_PRINTING_FAKE_PRINTER_DISCOVERER_H_ | |
6 #define CHROME_BROWSER_CHROMEOS_PRINTING_FAKE_PRINTER_DISCOVERER_H_ | |
7 | |
8 #include <vector> | |
9 | |
10 #include "base/macros.h" | |
11 #include "base/memory/weak_ptr.h" | |
12 #include "chrome/browser/chromeos/printing/printer_discoverer.h" | |
13 #include "chromeos/printing/printer_configuration.h" | |
14 | |
15 namespace chromeos { | |
16 | |
17 class FakePrinterDiscoverer : public PrinterDiscoverer { | |
18 public: | |
19 FakePrinterDiscoverer(); | |
20 ~FakePrinterDiscoverer() override; | |
21 | |
22 bool StartDiscovery() override; | |
23 bool StopDiscovery() override; | |
24 void AddObserver(PrinterDiscoverer::Observer* observer) override; | |
25 void RemoveObserver(PrinterDiscoverer::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<PrinterDiscoverer::Observer*> observers_; | |
33 | |
34 base::WeakPtrFactory<FakePrinterDiscoverer> weak_ptr_factory_; | |
35 | |
36 DISALLOW_COPY_AND_ASSIGN(FakePrinterDiscoverer); | |
37 }; | |
38 | |
39 } // namespace chromeos | |
40 | |
41 #endif // CHROME_BROWSER_CHROMEOS_PRINTING_FAKE_PRINTER_DISCOVERER_H_ | |
OLD | NEW |