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

Side by Side Diff: content/browser/gamepad/gamepad_platform_data_fetcher_linux.h

Issue 2081583002: Migrating majority of gamepad from content/browser/ to device/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Next attempt Created 4 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CONTENT_BROWSER_GAMEPAD_GAMEPAD_PLATFORM_DATA_FETCHER_LINUX_H_
6 #define CONTENT_BROWSER_GAMEPAD_GAMEPAD_PLATFORM_DATA_FETCHER_LINUX_H_
7
8 #include <stddef.h>
9
10 #include <memory>
11 #include <string>
12
13 #include "base/compiler_specific.h"
14 #include "base/macros.h"
15 #include "content/browser/gamepad/gamepad_data_fetcher.h"
16
17 extern "C" {
18 struct udev_device;
19 }
20
21 namespace device {
22 class UdevLinux;
23 }
24
25 namespace content {
26
27 class GamepadPlatformDataFetcherLinux : public GamepadDataFetcher {
28 public:
29 GamepadPlatformDataFetcherLinux();
30 ~GamepadPlatformDataFetcherLinux() override;
31
32 // GamepadDataFetcher implementation.
33 void GetGamepadData(blink::WebGamepads* pads,
34 bool devices_changed_hint) override;
35
36 private:
37 void RefreshDevice(udev_device* dev);
38 void EnumerateDevices();
39 void ReadDeviceData(size_t index);
40
41 // File descriptor for the /dev/input/js* devices. -1 if not in use.
42 int device_fd_[blink::WebGamepads::itemsLengthCap];
43
44 std::unique_ptr<device::UdevLinux> udev_;
45
46 DISALLOW_COPY_AND_ASSIGN(GamepadPlatformDataFetcherLinux);
47 };
48
49 } // namespace content
50
51 #endif // CONTENT_BROWSER_GAMEPAD_GAMEPAD_PLATFORM_DATA_FETCHER_LINUX_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698