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

Side by Side Diff: chrome/browser/chromeos/printing/fake_printer_discoverer.h

Issue 2790603003: Make CUPS USB printing play better with the settings page. This change does several things: (Closed)
Patch Set: stop latching PrintersManager, add comments Created 3 years, 8 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 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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698