summaryrefslogtreecommitdiffstats
path: root/device/hid/hid_report_descriptor.h
diff options
context:
space:
mode:
authorrockot@chromium.org <rockot@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-25 00:16:40 +0000
committerrockot@chromium.org <rockot@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-04-25 00:16:40 +0000
commitfe7b300e384f4f7d593d0e39ed4c132577c52e63 (patch)
tree5ff70cf4d1cbc4fd8449208955fc63b1453d6838 /device/hid/hid_report_descriptor.h
parent25c9e66e7408cf3025a1e208b05b75496bd5237b (diff)
downloadchromium_src-fe7b300e384f4f7d593d0e39ed4c132577c52e63.zip
chromium_src-fe7b300e384f4f7d593d0e39ed4c132577c52e63.tar.gz
chromium_src-fe7b300e384f4f7d593d0e39ed4c132577c52e63.tar.bz2
HID: Support top-level collection usages in device info.
This CL exists as an effort to actually land https://codereview.chromium.org/225513005/. This applies a small fix to the hid_service_win.cc module. BUG=359560 TBR=rpaquay TBR=jracle@logitech.com Review URL: https://codereview.chromium.org/256673002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@266066 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'device/hid/hid_report_descriptor.h')
-rw-r--r--device/hid/hid_report_descriptor.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/device/hid/hid_report_descriptor.h b/device/hid/hid_report_descriptor.h
new file mode 100644
index 0000000..fa67fa4
--- /dev/null
+++ b/device/hid/hid_report_descriptor.h
@@ -0,0 +1,38 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef DEVICE_HID_HID_REPORT_DESCRIPTOR_H_
+#define DEVICE_HID_HID_REPORT_DESCRIPTOR_H_
+
+#include <vector>
+
+#include "base/memory/linked_ptr.h"
+#include "device/hid/hid_report_descriptor_item.h"
+#include "device/hid/hid_usage_and_page.h"
+
+namespace device {
+
+// HID report descriptor.
+// See section 6.2.2 of HID specifications (v1.11).
+class HidReportDescriptor {
+
+ public:
+ HidReportDescriptor(const uint8_t* bytes, size_t size);
+ ~HidReportDescriptor();
+
+ const std::vector<linked_ptr<HidReportDescriptorItem> >& items() const {
+ return items_;
+ }
+
+ // Returns HID usages of top-level collections present in the descriptor.
+ void GetTopLevelCollections(
+ std::vector<HidUsageAndPage>* topLevelCollections);
+
+ private:
+ std::vector<linked_ptr<HidReportDescriptorItem> > items_;
+};
+
+} // namespace device
+
+#endif // DEVICE_HID_HID_REPORT_DESCRIPTOR_H_