Roll src/third_party/skia 57a48a7:de7665a
[chromium-blink-merge.git] / device / usb / usb_device_filter.h
blob6525f8fdd81196ccd18e7797aae135b0fa8be53f
1 // Copyright 2014 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 DEVICE_USB_USB_DEVICE_FILTER_H_
6 #define DEVICE_USB_USB_DEVICE_FILTER_H_
8 #include <vector>
10 #include "base/memory/ref_counted.h"
12 namespace base {
13 class Value;
16 namespace device {
18 class UsbDevice;
20 class UsbDeviceFilter {
21 public:
22 UsbDeviceFilter();
23 ~UsbDeviceFilter();
25 void SetVendorId(uint16 vendor_id);
26 void SetProductId(uint16 product_id);
27 void SetInterfaceClass(uint8 interface_class);
28 void SetInterfaceSubclass(uint8 interface_subclass);
29 void SetInterfaceProtocol(uint8 interface_protocol);
31 bool Matches(scoped_refptr<UsbDevice> device) const;
32 base::Value* ToValue() const;
34 static bool MatchesAny(scoped_refptr<UsbDevice> device,
35 const std::vector<UsbDeviceFilter>& filters);
37 private:
38 uint16 vendor_id_;
39 uint16 product_id_;
40 uint8 interface_class_;
41 uint8 interface_subclass_;
42 uint8 interface_protocol_;
43 bool vendor_id_set_ : 1;
44 bool product_id_set_ : 1;
45 bool interface_class_set_ : 1;
46 bool interface_subclass_set_ : 1;
47 bool interface_protocol_set_ : 1;
50 } // namespace device
52 #endif // DEVICE_USB_USB_DEVICE_FILTER_H_