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

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

Issue 302093009: Linux: Unify udev scopers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 6 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
« no previous file with comments | « device/hid/hid_connection_linux.h ('k') | device/hid/udev_common.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 <linux/hidraw.h> 5 #include <linux/hidraw.h>
6 #include <sys/ioctl.h> 6 #include <sys/ioctl.h>
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
11 11
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/files/file_path.h" 13 #include "base/files/file_path.h"
14 #include "base/logging.h" 14 #include "base/logging.h"
15 #include "base/platform_file.h" 15 #include "base/platform_file.h"
16 #include "base/stl_util.h" 16 #include "base/stl_util.h"
17 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
18 #include "base/strings/string_piece.h" 18 #include "base/strings/string_piece.h"
19 #include "base/strings/string_split.h" 19 #include "base/strings/string_split.h"
20 #include "device/hid/hid_connection_linux.h" 20 #include "device/hid/hid_connection_linux.h"
21 #include "device/hid/hid_device_info.h" 21 #include "device/hid/hid_device_info.h"
22 #include "device/hid/hid_report_descriptor.h" 22 #include "device/hid/hid_report_descriptor.h"
23 #include "device/hid/hid_service_linux.h" 23 #include "device/hid/hid_service_linux.h"
24 #include "device/hid/udev_common.h" 24 #include "device/udev_linux/udev.h"
25 25
26 namespace device { 26 namespace device {
27 27
28 namespace { 28 namespace {
29 29
30 const char kHIDSubSystem[] = "hid"; 30 const char kHIDSubSystem[] = "hid";
31 const char kHidrawSubsystem[] = "hidraw"; 31 const char kHidrawSubsystem[] = "hidraw";
32 const char kHIDID[] = "HID_ID"; 32 const char kHIDID[] = "HID_ID";
33 const char kHIDName[] = "HID_NAME"; 33 const char kHIDName[] = "HID_NAME";
34 const char kHIDUnique[] = "HID_UNIQ"; 34 const char kHIDUnique[] = "HID_UNIQ";
35 35
36 } // namespace 36 } // namespace
37 37
38 HidServiceLinux::HidServiceLinux() { 38 HidServiceLinux::HidServiceLinux() {
39 DeviceMonitorLinux* monitor = DeviceMonitorLinux::GetInstance(); 39 DeviceMonitorLinux* monitor = DeviceMonitorLinux::GetInstance();
40 monitor->AddObserver(this); 40 monitor->AddObserver(this);
41 monitor->Enumerate( 41 monitor->Enumerate(
42 base::Bind(&HidServiceLinux::OnDeviceAdded, base::Unretained(this))); 42 base::Bind(&HidServiceLinux::OnDeviceAdded, base::Unretained(this)));
43 } 43 }
44 44
45 scoped_refptr<HidConnection> HidServiceLinux::Connect( 45 scoped_refptr<HidConnection> HidServiceLinux::Connect(
46 const HidDeviceId& device_id) { 46 const HidDeviceId& device_id) {
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 kHidrawSubsystem) { 191 kHidrawSubsystem) {
192 *result = raw_path; 192 *result = raw_path;
193 return true; 193 return true;
194 } 194 }
195 } 195 }
196 } 196 }
197 197
198 return false; 198 return false;
199 } 199 }
200 200
201 } // namespace dev 201 } // namespace device
OLDNEW
« no previous file with comments | « device/hid/hid_connection_linux.h ('k') | device/hid/udev_common.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698