| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef DEVICE_HID_HID_DEVICE_INFO_H_ | 5 #ifndef DEVICE_HID_HID_DEVICE_INFO_H_ |
| 6 #define DEVICE_HID_HID_DEVICE_INFO_H_ | 6 #define DEVICE_HID_HID_DEVICE_INFO_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "build/build_config.h" | 12 #include "build/build_config.h" |
| 13 #include "device/hid/hid_collection_info.h" | 13 #include "device/hid/hid_collection_info.h" |
| 14 | 14 |
| 15 namespace device { | 15 namespace device { |
| 16 | 16 |
| 17 enum HidBusType { | 17 enum HidBusType { |
| 18 kHIDBusTypeUSB = 0, | 18 kHIDBusTypeUSB = 0, |
| 19 kHIDBusTypeBluetooth = 1, | 19 kHIDBusTypeBluetooth = 1, |
| 20 }; | 20 }; |
| 21 | 21 |
| 22 #if defined(OS_MACOSX) |
| 23 typedef uint64_t HidDeviceId; |
| 24 const uint64_t kInvalidHidDeviceId = -1; |
| 25 #else |
| 22 typedef std::string HidDeviceId; | 26 typedef std::string HidDeviceId; |
| 23 extern const char kInvalidHidDeviceId[]; | 27 extern const char kInvalidHidDeviceId[]; |
| 28 #endif |
| 24 | 29 |
| 25 class HidDeviceInfo : public base::RefCountedThreadSafe<HidDeviceInfo> { | 30 class HidDeviceInfo : public base::RefCountedThreadSafe<HidDeviceInfo> { |
| 26 public: | 31 public: |
| 27 HidDeviceInfo(const HidDeviceId& device_id, | 32 HidDeviceInfo(const HidDeviceId& device_id, |
| 28 uint16_t vendor_id, | 33 uint16_t vendor_id, |
| 29 uint16_t product_id, | 34 uint16_t product_id, |
| 30 const std::string& product_name, | 35 const std::string& product_name, |
| 31 const std::string& serial_number, | 36 const std::string& serial_number, |
| 32 HidBusType bus_type, | 37 HidBusType bus_type, |
| 33 const std::vector<uint8> report_descriptor); | 38 const std::vector<uint8> report_descriptor); |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 size_t max_input_report_size_; | 91 size_t max_input_report_size_; |
| 87 size_t max_output_report_size_; | 92 size_t max_output_report_size_; |
| 88 size_t max_feature_report_size_; | 93 size_t max_feature_report_size_; |
| 89 | 94 |
| 90 DISALLOW_COPY_AND_ASSIGN(HidDeviceInfo); | 95 DISALLOW_COPY_AND_ASSIGN(HidDeviceInfo); |
| 91 }; | 96 }; |
| 92 | 97 |
| 93 } // namespace device | 98 } // namespace device |
| 94 | 99 |
| 95 #endif // DEVICE_HID_HID_DEVICE_INFO_H_ | 100 #endif // DEVICE_HID_HID_DEVICE_INFO_H_ |
| OLD | NEW |