Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef EXTENSIONS_COMMON_API_PRINTER_PROVIDER_USB_PRINTER_MANIFEST_DATA_H_ | 5 #ifndef EXTENSIONS_COMMON_API_PRINTER_PROVIDER_USB_PRINTER_MANIFEST_DATA_H_ |
| 6 #define EXTENSIONS_COMMON_API_PRINTER_PROVIDER_USB_PRINTER_MANIFEST_DATA_H_ | 6 #define EXTENSIONS_COMMON_API_PRINTER_PROVIDER_USB_PRINTER_MANIFEST_DATA_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "extensions/common/extension.h" | 10 #include "extensions/common/extension.h" |
| 11 | 11 |
| 12 namespace device { | 12 namespace device { |
| 13 class UsbDevice; | |
| 13 class UsbDeviceFilter; | 14 class UsbDeviceFilter; |
| 14 } | 15 } |
| 15 | 16 |
| 16 namespace extensions { | 17 namespace extensions { |
| 17 | 18 |
| 18 // The parsed form of the "usb_printers" manifest entry. | 19 // The parsed form of the "usb_printers" manifest entry. |
| 19 class UsbPrinterManifestData : public Extension::ManifestData { | 20 class UsbPrinterManifestData : public Extension::ManifestData { |
| 20 public: | 21 public: |
| 21 UsbPrinterManifestData(); | 22 UsbPrinterManifestData(); |
| 22 ~UsbPrinterManifestData() override; | 23 ~UsbPrinterManifestData() override; |
| 23 | 24 |
| 24 // Gets the UsbPrinterManifestData for |extension|, or NULL if none was | 25 // Gets the UsbPrinterManifestData for |extension|, or NULL if none was |
| 25 // specified. | 26 // specified. |
| 26 static const UsbPrinterManifestData* Get(const Extension* extension); | 27 static const UsbPrinterManifestData* Get(const Extension* extension); |
| 27 | 28 |
| 28 // Parses the data stored in |value|. Sets |error| and returns an empty | 29 // Parses the data stored in |value|. Sets |error| and returns an empty |
| 29 // scoped_ptr on failure. | 30 // scoped_ptr on failure. |
| 30 static scoped_ptr<UsbPrinterManifestData> FromValue(const base::Value& value, | 31 static scoped_ptr<UsbPrinterManifestData> FromValue(const base::Value& value, |
| 31 base::string16* error); | 32 base::string16* error); |
| 32 | 33 |
| 34 bool SupportsDevice(scoped_refptr<device::UsbDevice> device) const; | |
|
Vitaly Buka (NO REVIEWS)
2015/05/28 22:50:55
const scoped_refptr<device::UsbDevice>&
Reilly Grant (use Gerrit)
2015/05/28 23:04:50
Done.
| |
| 35 | |
| 33 const std::vector<device::UsbDeviceFilter>& filters() const { | 36 const std::vector<device::UsbDeviceFilter>& filters() const { |
| 34 return filters_; | 37 return filters_; |
| 35 } | 38 } |
| 36 | 39 |
| 37 private: | 40 private: |
| 38 std::vector<device::UsbDeviceFilter> filters_; | 41 std::vector<device::UsbDeviceFilter> filters_; |
| 39 }; | 42 }; |
| 40 | 43 |
| 41 } // namespace extensions | 44 } // namespace extensions |
| 42 | 45 |
| 43 #endif // EXTENSIONS_COMMON_API_PRINTER_PROVIDER_USB_PRINTER_MANIFEST_DATA_H_ | 46 #endif // EXTENSIONS_COMMON_API_PRINTER_PROVIDER_USB_PRINTER_MANIFEST_DATA_H_ |
| OLD | NEW |