Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 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 // Utility routines for working with UsbDevices that are printers. | |
| 6 | |
| 7 #ifndef CHROME_BROWSER_CHROMEOS_PRINTING_USB_UTIL_H__ | |
| 8 #define CHROME_BROWSER_CHROMEOS_PRINTING_USB_UTIL_H__ | |
| 9 | |
| 10 #include <string> | |
| 11 | |
| 12 #include "base/logging.h" | |
|
tbarzic
2017/03/14 01:43:33
can you remove includes you don't need here?
Carlson
2017/03/15 00:31:16
Done.
| |
| 13 #include "base/memory/ref_counted.h" | |
| 14 #include "base/strings/stringprintf.h" | |
| 15 #include "base/strings/utf_string_conversions.h" | |
| 16 #include "chromeos/printing/printer_configuration.h" | |
| 17 #include "device/usb/usb_device.h" | |
| 18 | |
|
tbarzic
2017/03/14 01:43:32
forward declare Printer and UsbDevice?
Carlson
2017/03/15 00:31:16
I didn't realize until today that the rules about
| |
| 19 namespace chromeos { | |
| 20 | |
| 21 bool UsbDeviceIsPrinter(scoped_refptr<device::UsbDevice> usb_device); | |
| 22 | |
| 23 // Convert the interesting details of a device to a string, for | |
| 24 // logging/debugging. | |
| 25 std::string UsbPrinterDeviceDetailsAsString(const device::UsbDevice& device); | |
| 26 | |
| 27 // Attempt to gather all the information we need to work with this printer by | |
| 28 // querying the USB device. This should only be called using devices we believe | |
| 29 // are printers, not arbitrary USB devices, as we may get weird partial results | |
| 30 // from arbitrary devices. | |
| 31 // | |
| 32 // Returns true on success. On false, printer may have partial results. | |
| 33 bool UsbDeviceToPrinter(const device::UsbDevice& device, | |
| 34 chromeos::Printer* printer); | |
| 35 | |
| 36 } // namespace chromeos | |
| 37 #endif // CHROME_BROWSER_CHROMEOS_PRINTING_USB_UTIL_H__ | |
| OLD | NEW |