Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: trunk/src/device/hid/hid_service_linux.cc

Issue 364213005: Revert 281282 "Revert 281133 "chrome.hid: enrich model with repo..." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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_linux.h" 5 #include "device/hid/hid_service_linux.h"
6 6
7 #include <linux/hidraw.h> 7 #include <linux/hidraw.h>
8 #include <sys/ioctl.h> 8 #include <sys/ioctl.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 res = ioctl(device_file.GetPlatformFile(), HIDIOCGRDESC, &rpt_desc); 141 res = ioctl(device_file.GetPlatformFile(), HIDIOCGRDESC, &rpt_desc);
142 if (res < 0) { 142 if (res < 0) {
143 PLOG(ERROR) << "Failed to get report descriptor"; 143 PLOG(ERROR) << "Failed to get report descriptor";
144 device_file.Close(); 144 device_file.Close();
145 return; 145 return;
146 } 146 }
147 147
148 device_file.Close(); 148 device_file.Close();
149 149
150 HidReportDescriptor report_descriptor(rpt_desc.value, rpt_desc.size); 150 HidReportDescriptor report_descriptor(rpt_desc.value, rpt_desc.size);
151 report_descriptor.GetTopLevelCollections(&device_info.usages); 151 report_descriptor.GetDetails(&device_info.collections,
152 &device_info.max_input_report_size,
153 &device_info.max_output_report_size,
154 &device_info.max_feature_report_size);
152 155
153 AddDevice(device_info); 156 AddDevice(device_info);
154 } 157 }
155 158
156 void HidServiceLinux::OnDeviceRemoved(udev_device* device) { 159 void HidServiceLinux::OnDeviceRemoved(udev_device* device) {
157 const char* device_path = udev_device_get_syspath(device);; 160 const char* device_path = udev_device_get_syspath(device);;
158 if (device_path) 161 if (device_path)
159 RemoveDevice(device_path); 162 RemoveDevice(device_path);
160 } 163 }
161 164
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 *result = raw_path; 196 *result = raw_path;
194 return true; 197 return true;
195 } 198 }
196 } 199 }
197 } 200 }
198 201
199 return false; 202 return false;
200 } 203 }
201 204
202 } // namespace device 205 } // namespace device
OLDNEW
« no previous file with comments | « trunk/src/device/hid/hid_report_descriptor_unittest.cc ('k') | trunk/src/device/hid/hid_service_mac.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698