Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / extensions / common / api / printer_provider / usb_printer_manifest_data.h
blobed397f0ede05e693386b4208574881edde6ff3a2
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.
5 #ifndef EXTENSIONS_COMMON_API_PRINTER_PROVIDER_USB_PRINTER_MANIFEST_DATA_H_
6 #define EXTENSIONS_COMMON_API_PRINTER_PROVIDER_USB_PRINTER_MANIFEST_DATA_H_
8 #include <vector>
10 #include "extensions/common/extension.h"
12 namespace device {
13 class UsbDevice;
14 class UsbDeviceFilter;
17 namespace extensions {
19 // The parsed form of the "usb_printers" manifest entry.
20 class UsbPrinterManifestData : public Extension::ManifestData {
21 public:
22 UsbPrinterManifestData();
23 ~UsbPrinterManifestData() override;
25 // Gets the UsbPrinterManifestData for |extension|, or NULL if none was
26 // specified.
27 static const UsbPrinterManifestData* Get(const Extension* extension);
29 // Parses the data stored in |value|. Sets |error| and returns an empty
30 // scoped_ptr on failure.
31 static scoped_ptr<UsbPrinterManifestData> FromValue(const base::Value& value,
32 base::string16* error);
34 bool SupportsDevice(const scoped_refptr<device::UsbDevice>& device) const;
36 const std::vector<device::UsbDeviceFilter>& filters() const {
37 return filters_;
40 private:
41 std::vector<device::UsbDeviceFilter> filters_;
44 } // namespace extensions
46 #endif // EXTENSIONS_COMMON_API_PRINTER_PROVIDER_USB_PRINTER_MANIFEST_DATA_H_