Revert of Instrumented libraries: update the libnspr4 build script. (patchset #1...
[chromium-blink-merge.git] / device / hid / hid_device_filter.h
bloba0abbb746583196f70bfed21e383bdfdbd937f1c
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_HID_HID_DEVICE_FILTER_H_
6 #define DEVICE_HID_HID_DEVICE_FILTER_H_
8 #include <stdint.h>
9 #include <vector>
11 namespace device {
13 struct HidDeviceInfo;
15 class HidDeviceFilter {
16 public:
17 HidDeviceFilter();
18 ~HidDeviceFilter();
20 void SetVendorId(uint16_t vendor_id);
21 void SetProductId(uint16_t product_id);
22 void SetUsagePage(uint16_t usage_page);
23 void SetUsage(uint16_t usage);
25 bool Matches(const HidDeviceInfo& device_info) const;
27 static bool MatchesAny(const HidDeviceInfo& device_info,
28 const std::vector<HidDeviceFilter>& filters);
30 private:
31 uint16_t vendor_id_;
32 uint16_t product_id_;
33 uint16_t usage_page_;
34 uint16_t usage_;
35 bool vendor_id_set_ : 1;
36 bool product_id_set_ : 1;
37 bool usage_page_set_ : 1;
38 bool usage_set_ : 1;
41 } // namespace device
43 #endif // DEVICE_HID_HID_DEVICE_FILTER_H_