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

Side by Side Diff: chrome/browser/chromeos/printer_detector/usb_printer_detector.h

Issue 2945653002: Remove the legacy (extension-notifier) usb printer detector. Rename the remaining printerdetector … (Closed)
Patch Set: Remove the legacy (extension-notifier) usb printer detector. Rename the remaining printerdetector … Created 3 years, 6 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 2015 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_PRINTER_DETECTOR_USB_PRINTER_DETECTOR_H_
6 #define CHROME_BROWSER_CHROMEOS_PRINTER_DETECTOR_USB_PRINTER_DETECTOR_H_
7
8 #include <memory>
9 #include <string>
10 #include <vector>
11
12 #include "base/macros.h"
13 #include "chromeos/printing/printer_configuration.h"
14 #include "components/keyed_service/core/keyed_service.h"
15
16 class Profile;
17
18 namespace chromeos {
19
20 // Observes device::UsbService for addition of USB printers (devices with
21 // interface class 7). When a device is detected, it is forwarded to the
22 // printing subsystem for either autoconfiguration or user guidance.
23 class UsbPrinterDetector : public KeyedService {
24 public:
25 class Observer {
26 public:
27 virtual ~Observer() = default;
28
29 // The set of available printers has changed.
30 virtual void OnAvailableUsbPrintersChanged(
31 const std::vector<Printer>& printers) = 0;
32 };
33
34 // Factory function for the CUPS implementation.
35 static std::unique_ptr<UsbPrinterDetector> Create(Profile* profile);
36 ~UsbPrinterDetector() override = default;
37
38 virtual void AddObserver(Observer* observer) = 0;
39 virtual void RemoveObserver(Observer* observer) = 0;
40
41 // Get the current set of detected printers.
42 virtual std::vector<Printer> GetPrinters() = 0;
43
44 protected:
45 UsbPrinterDetector() = default;
46
47 private:
48 DISALLOW_COPY_AND_ASSIGN(UsbPrinterDetector);
49 };
50
51 } // namespace chromeos
52
53 #endif // CHROME_BROWSER_CHROMEOS_PRINTER_DETECTOR_USB_PRINTER_DETECTOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698