| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/gamepad/gamepad_platform_data_fetcher_linux.h" | 5 #include "content/browser/gamepad/gamepad_platform_data_fetcher_linux.h" |
| 6 | 6 |
| 7 #include <fcntl.h> | 7 #include <fcntl.h> |
| 8 #include <libudev.h> | 8 #include <libudev.h> |
| 9 #include <linux/joystick.h> | 9 #include <linux/joystick.h> |
| 10 #include <string.h> | 10 #include <string.h> |
| 11 #include <sys/stat.h> | 11 #include <sys/stat.h> |
| 12 #include <sys/types.h> | 12 #include <sys/types.h> |
| 13 #include <unistd.h> | 13 #include <unistd.h> |
| 14 | 14 |
| 15 #include "base/debug/trace_event.h" | 15 #include "base/debug/trace_event.h" |
| 16 #include "base/eintr_wrapper.h" | |
| 17 #include "base/message_loop.h" | 16 #include "base/message_loop.h" |
| 17 #include "base/posix/eintr_wrapper.h" |
| 18 #include "base/string_number_conversions.h" | 18 #include "base/string_number_conversions.h" |
| 19 #include "base/string_util.h" | 19 #include "base/string_util.h" |
| 20 #include "base/stringprintf.h" | 20 #include "base/stringprintf.h" |
| 21 #include "base/utf_string_conversions.h" | 21 #include "base/utf_string_conversions.h" |
| 22 #include "content/browser/udev_linux.h" | 22 #include "content/browser/udev_linux.h" |
| 23 | 23 |
| 24 namespace { | 24 namespace { |
| 25 | 25 |
| 26 const char kInputSubsystem[] = "input"; | 26 const char kInputSubsystem[] = "input"; |
| 27 const char kUsbSubsystem[] = "usb"; | 27 const char kUsbSubsystem[] = "usb"; |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 continue; | 248 continue; |
| 249 pad.buttons[item] = event.value ? 1.0 : 0.0; | 249 pad.buttons[item] = event.value ? 1.0 : 0.0; |
| 250 if (item >= pad.buttonsLength) | 250 if (item >= pad.buttonsLength) |
| 251 pad.buttonsLength = item + 1; | 251 pad.buttonsLength = item + 1; |
| 252 } | 252 } |
| 253 pad.timestamp = event.time; | 253 pad.timestamp = event.time; |
| 254 } | 254 } |
| 255 } | 255 } |
| 256 | 256 |
| 257 } // namespace content | 257 } // namespace content |
| OLD | NEW |