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

Side by Side Diff: chromeos/printing/fake_printer_detector.h

Issue 2344393002: Add a PrinterDiscoverer fake object. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
OLDNEW
(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 CHREOMOS_PRINTING_FAKE_PRINTER_DETECTOR_H_
7
8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h"
10 #include "chromeos/printing/printer_configuration.h"
11 #include "chromeos/printing/printer_detector.h"
12
13 namespace chromeos {
14
15 class FakePrinterDetector : public PrinterDetector {
16 public:
17 FakePrinterDetector();
18 ~FakePrinterDetector();
19
20 bool StartDiscovery() override;
21 bool StopDiscovery() override;
22 void SetObserver(PrinterDetector::Observer* observer) override;
23
24 private:
25 void EmitPrinters(size_t start, size_t end);
26
27 std::vector<chromeos::Printer> printers_;
28 bool discovery_running_;
29 PrinterDetector::Observer* observer_;
30
31 base::WeakPtrFactory<FakePrinterDetector> weak_ptr_factory_;
32
33 DISALLOW_COPY_AND_ASSIGN(FakePrinterDetector);
34 };
35
36 } // namespace chromeos
37
38 #endif // CHREOMOS_PRINTING_FAKE_PRINTER_DETECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698