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 #include "device/hid/hid_service_win.h" | 5 #include "device/hid/hid_service_win.h" |
6 | 6 |
7 #define INITGUID | 7 #define INITGUID |
8 | 8 |
9 #include <dbt.h> | 9 #include <dbt.h> |
10 #include <setupapi.h> | 10 #include <setupapi.h> |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
114 device_info_set, &device_interface_data, | 114 device_info_set, &device_interface_data, |
115 device_interface_detail_data.get(), required_size, NULL, NULL); | 115 device_interface_detail_data.get(), required_size, NULL, NULL); |
116 if (!res) { | 116 if (!res) { |
117 continue; | 117 continue; |
118 } | 118 } |
119 | 119 |
120 std::string device_path( | 120 std::string device_path( |
121 base::SysWideToUTF8(device_interface_detail_data->DevicePath)); | 121 base::SysWideToUTF8(device_interface_detail_data->DevicePath)); |
122 DCHECK(base::IsStringASCII(device_path)); | 122 DCHECK(base::IsStringASCII(device_path)); |
123 AddDeviceOnFileThread(service, task_runner, | 123 AddDeviceOnFileThread(service, task_runner, |
124 base::StringToLowerASCII(device_path)); | 124 base::ToLowerASCII(device_path)); |
125 } | 125 } |
126 } | 126 } |
127 | 127 |
128 task_runner->PostTask( | 128 task_runner->PostTask( |
129 FROM_HERE, base::Bind(&HidServiceWin::FirstEnumerationComplete, service)); | 129 FROM_HERE, base::Bind(&HidServiceWin::FirstEnumerationComplete, service)); |
130 } | 130 } |
131 | 131 |
132 // static | 132 // static |
133 void HidServiceWin::CollectInfoFromButtonCaps( | 133 void HidServiceWin::CollectInfoFromButtonCaps( |
134 PHIDP_PREPARSED_DATA preparsed_data, | 134 PHIDP_PREPARSED_DATA preparsed_data, |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 FILE_FLAG_OVERLAPPED, NULL)); | 300 FILE_FLAG_OVERLAPPED, NULL)); |
301 if (!file.IsValid() && | 301 if (!file.IsValid() && |
302 GetLastError() == base::File::FILE_ERROR_ACCESS_DENIED) { | 302 GetLastError() == base::File::FILE_ERROR_ACCESS_DENIED) { |
303 file.Set(CreateFileA(device_path.c_str(), GENERIC_READ, FILE_SHARE_READ, | 303 file.Set(CreateFileA(device_path.c_str(), GENERIC_READ, FILE_SHARE_READ, |
304 NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL)); | 304 NULL, OPEN_EXISTING, FILE_FLAG_OVERLAPPED, NULL)); |
305 } | 305 } |
306 return file.Pass(); | 306 return file.Pass(); |
307 } | 307 } |
308 | 308 |
309 } // namespace device | 309 } // namespace device |
OLD | NEW |