Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(846)

Unified Diff: device/hid/hid_report_descriptor.h

Issue 225513005: chrome.hid : enrich device info with Top-Level collections usages (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: HidUsageAndPage::Page Created 6 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/hid/hid_device_info.cc ('k') | device/hid/hid_report_descriptor.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/hid/hid_report_descriptor.h
diff --git a/device/hid/hid_report_descriptor.h b/device/hid/hid_report_descriptor.h
new file mode 100644
index 0000000000000000000000000000000000000000..fa67fa43c291aa033bb648bbf38faeacc0618d80
--- /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_
« no previous file with comments | « device/hid/hid_device_info.cc ('k') | device/hid/hid_report_descriptor.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698