| 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_LINUX_H_ | 5 #ifndef DEVICE_HID_HID_SERVICE_LINUX_H_ |
| 6 #define DEVICE_HID_HID_SERVICE_LINUX_H_ | 6 #define DEVICE_HID_HID_SERVICE_LINUX_H_ |
| 7 | 7 |
| 8 #include <libudev.h> | 8 #include <libudev.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 56 virtual scoped_refptr<HidConnection> Connect(const HidDeviceId& device_id) | 56 virtual scoped_refptr<HidConnection> Connect(const HidDeviceId& device_id) |
| 57 OVERRIDE; | 57 OVERRIDE; |
| 58 | 58 |
| 59 // Implements base::MessagePumpLibevent::Watcher | 59 // Implements base::MessagePumpLibevent::Watcher |
| 60 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; | 60 virtual void OnFileCanReadWithoutBlocking(int fd) OVERRIDE; |
| 61 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; | 61 virtual void OnFileCanWriteWithoutBlocking(int fd) OVERRIDE; |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 virtual ~HidServiceLinux(); | 64 virtual ~HidServiceLinux(); |
| 65 | 65 |
| 66 static bool FindHidrawDevNode(udev_device* parent, std::string* result); |
| 67 |
| 66 void Enumerate(); | 68 void Enumerate(); |
| 67 void PlatformAddDevice(udev_device* device); | 69 void PlatformAddDevice(udev_device* device); |
| 68 void PlatformRemoveDevice(udev_device* raw_dev); | 70 void PlatformRemoveDevice(udev_device* raw_dev); |
| 69 | 71 |
| 70 scoped_ptr<udev, UdevDeleter> udev_; | 72 scoped_ptr<udev, UdevDeleter> udev_; |
| 71 scoped_ptr<udev_monitor, UdevMonitorDeleter> monitor_; | 73 scoped_ptr<udev_monitor, UdevMonitorDeleter> monitor_; |
| 72 int monitor_fd_; | 74 int monitor_fd_; |
| 73 base::MessagePumpLibevent::FileDescriptorWatcher monitor_watcher_; | 75 base::MessagePumpLibevent::FileDescriptorWatcher monitor_watcher_; |
| 74 | 76 |
| 75 DISALLOW_COPY_AND_ASSIGN(HidServiceLinux); | 77 DISALLOW_COPY_AND_ASSIGN(HidServiceLinux); |
| 76 }; | 78 }; |
| 77 | 79 |
| 78 } // namespace device | 80 } // namespace device |
| 79 | 81 |
| 80 #endif // DEVICE_HID_HID_SERVICE_LINUX_H_ | 82 #endif // DEVICE_HID_HID_SERVICE_LINUX_H_ |
| OLD | NEW |