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 #define INITGUID | |
rpaquay
2014/08/22 21:36:30
I am surprised this works, as usually INITGUID is
Reilly Grant (use Gerrit)
2014/08/22 21:54:54
It works but probably only because of the limited
| |
16 | |
17 #include <windows.h> | |
18 #include <hidclass.h> | |
19 | |
20 extern "C" { | |
21 #include <hidsdi.h> | |
22 #include <hidpi.h> | |
23 } | |
24 | |
25 #endif // defined(OS_WIN) | |
26 | |
13 namespace device { | 27 namespace device { |
14 | 28 |
15 class HidConnection; | 29 class HidConnection; |
16 | 30 |
17 class HidServiceWin : public HidService { | 31 class HidServiceWin : public HidService { |
18 public: | 32 public: |
19 HidServiceWin(); | 33 HidServiceWin(); |
20 | 34 |
21 virtual void GetDevices(std::vector<HidDeviceInfo>* devices) OVERRIDE; | 35 virtual void GetDevices(std::vector<HidDeviceInfo>* devices) OVERRIDE; |
22 | 36 |
23 virtual scoped_refptr<HidConnection> Connect(const HidDeviceId& device_id) | 37 virtual scoped_refptr<HidConnection> Connect(const HidDeviceId& device_id) |
24 OVERRIDE; | 38 OVERRIDE; |
25 | 39 |
26 private: | 40 private: |
27 virtual ~HidServiceWin(); | 41 virtual ~HidServiceWin(); |
28 | 42 |
29 void Enumerate(); | 43 void Enumerate(); |
44 static void CollectInfoFromButtonCaps(PHIDP_PREPARSED_DATA preparsed_data, | |
45 HIDP_REPORT_TYPE report_type, | |
46 USHORT button_caps_length, | |
47 HidCollectionInfo* collection_info); | |
48 static void CollectInfoFromValueCaps(PHIDP_PREPARSED_DATA preparsed_data, | |
49 HIDP_REPORT_TYPE report_type, | |
50 USHORT value_caps_length, | |
51 HidCollectionInfo* collection_info); | |
30 void PlatformAddDevice(const std::string& device_path); | 52 void PlatformAddDevice(const std::string& device_path); |
31 void PlatformRemoveDevice(const std::string& device_path); | 53 void PlatformRemoveDevice(const std::string& device_path); |
32 | 54 |
33 DISALLOW_COPY_AND_ASSIGN(HidServiceWin); | 55 DISALLOW_COPY_AND_ASSIGN(HidServiceWin); |
34 }; | 56 }; |
35 | 57 |
36 } // namespace device | 58 } // namespace device |
37 | 59 |
38 #endif // DEVICE_HID_HID_SERVICE_WIN_H_ | 60 #endif // DEVICE_HID_HID_SERVICE_WIN_H_ |
OLD | NEW |