summaryrefslogtreecommitdiffstats
path: root/device/hid/hid_device_info_linux.h
diff options
context:
space:
mode:
authorreillyg <reillyg@chromium.org>2015-01-12 19:07:11 -0800
committerCommit bot <commit-bot@chromium.org>2015-01-13 03:08:07 +0000
commit37cde99564e8a0789b5904680fa60aa046c6efcc (patch)
tree2a764f83cacfd6328117f0c502a1ec44ec2d851c /device/hid/hid_device_info_linux.h
parent8dec34f8f3504352e4eef95b2aaa36c561aea930 (diff)
downloadchromium_src-37cde99564e8a0789b5904680fa60aa046c6efcc.zip
chromium_src-37cde99564e8a0789b5904680fa60aa046c6efcc.tar.gz
chromium_src-37cde99564e8a0789b5904680fa60aa046c6efcc.tar.bz2
Include raw HID report descriptor in HID device info.
This change includes the raw HID report descriptor in the HidDeviceInfo class and exposes it to apps and extensions using the chrome.hid API. For simplicity on OS X the platform APIs for collecting information from the report descriptor are no longer used and instead the parsing code from Linux is used. On Windows the raw HID report descriptor is not available because Windows exposes HID devices on a per-top-level collection basis. BUG=442818 Review URL: https://codereview.chromium.org/801833003 Cr-Commit-Position: refs/heads/master@{#311192}
Diffstat (limited to 'device/hid/hid_device_info_linux.h')
-rw-r--r--device/hid/hid_device_info_linux.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/device/hid/hid_device_info_linux.h b/device/hid/hid_device_info_linux.h
new file mode 100644
index 0000000..df2cd97
--- /dev/null
+++ b/device/hid/hid_device_info_linux.h
@@ -0,0 +1,33 @@
+// Copyright 2015 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_DEVICE_INFO_LINUX_H_
+#define DEVICE_HID_HID_DEVICE_INFO_LINUX_H_
+
+#include "device/hid/hid_device_info.h"
+
+namespace device {
+
+class HidDeviceInfoLinux : public HidDeviceInfo {
+ public:
+ HidDeviceInfoLinux(const HidDeviceId& device_id,
+ const std::string& device_node,
+ uint16_t vendor_id,
+ uint16_t product_id,
+ const std::string& product_name,
+ const std::string& serial_number,
+ HidBusType bus_type,
+ const std::vector<uint8> report_descriptor);
+
+ const std::string& device_node() const { return device_node_; }
+
+ private:
+ ~HidDeviceInfoLinux() override;
+
+ std::string device_node_;
+};
+
+} // namespace device
+
+#endif // DEVICE_HID_HID_DEVICE_INFO_LINUX_H_