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_SERVICE_WIN_H_ | 5 #ifndef DEVICE_HID_HID_SERVICE_WIN_H_ |
6 #define DEVICE_HID_HID_SERVICE_WIN_H_ | 6 #define DEVICE_HID_HID_SERVICE_WIN_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "device/hid/hid_device_info.h" | 10 #include "device/hid/hid_device_info.h" |
11 #include "device/hid/hid_service.h" | 11 #include "device/hid/hid_service.h" |
12 | 12 |
| 13 #if defined(OS_WIN) |
| 14 |
| 15 #include <windows.h> |
| 16 #include <hidclass.h> |
| 17 |
| 18 extern "C" { |
| 19 #include <hidsdi.h> |
| 20 #include <hidpi.h> |
| 21 } |
| 22 |
| 23 #endif // defined(OS_WIN) |
| 24 |
13 namespace device { | 25 namespace device { |
14 | 26 |
15 class HidConnection; | 27 class HidConnection; |
16 | 28 |
17 class HidServiceWin : public HidService { | 29 class HidServiceWin : public HidService { |
18 public: | 30 public: |
19 HidServiceWin(); | 31 HidServiceWin(); |
20 | 32 |
21 virtual void GetDevices(std::vector<HidDeviceInfo>* devices) OVERRIDE; | 33 virtual void GetDevices(std::vector<HidDeviceInfo>* devices) OVERRIDE; |
22 | 34 |
23 virtual scoped_refptr<HidConnection> Connect(const HidDeviceId& device_id) | 35 virtual scoped_refptr<HidConnection> Connect(const HidDeviceId& device_id) |
24 OVERRIDE; | 36 OVERRIDE; |
25 | 37 |
26 private: | 38 private: |
27 virtual ~HidServiceWin(); | 39 virtual ~HidServiceWin(); |
28 | 40 |
29 void Enumerate(); | 41 void Enumerate(); |
| 42 static void CollectInfoFromButtonCaps(PHIDP_PREPARSED_DATA preparsed_data, |
| 43 HIDP_REPORT_TYPE report_type, |
| 44 USHORT button_caps_length, |
| 45 HidCollectionInfo* collection_info); |
| 46 static void CollectInfoFromValueCaps(PHIDP_PREPARSED_DATA preparsed_data, |
| 47 HIDP_REPORT_TYPE report_type, |
| 48 USHORT value_caps_length, |
| 49 HidCollectionInfo* collection_info); |
30 void PlatformAddDevice(const std::string& device_path); | 50 void PlatformAddDevice(const std::string& device_path); |
31 void PlatformRemoveDevice(const std::string& device_path); | 51 void PlatformRemoveDevice(const std::string& device_path); |
32 | 52 |
33 DISALLOW_COPY_AND_ASSIGN(HidServiceWin); | 53 DISALLOW_COPY_AND_ASSIGN(HidServiceWin); |
34 }; | 54 }; |
35 | 55 |
36 } // namespace device | 56 } // namespace device |
37 | 57 |
38 #endif // DEVICE_HID_HID_SERVICE_WIN_H_ | 58 #endif // DEVICE_HID_HID_SERVICE_WIN_H_ |
OLD | NEW |