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 CONTENT_PUBLIC_RENDERER_RENDERER_GAMEPAD_PROVIDER_H_ | 5 #ifndef CONTENT_PUBLIC_RENDERER_RENDERER_GAMEPAD_PROVIDER_H_ |
6 #define CONTENT_PUBLIC_RENDERER_RENDERER_GAMEPAD_PROVIDER_H_ | 6 #define CONTENT_PUBLIC_RENDERER_RENDERER_GAMEPAD_PROVIDER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "content/public/renderer/platform_event_observer.h" | 9 #include "content/public/renderer/platform_event_observer.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 class WebGamepadListener; | 12 class WebGamepadListener; |
13 class WebGamepads; | 13 } |
| 14 |
| 15 namespace device { |
| 16 class Gamepads; |
14 } | 17 } |
15 | 18 |
16 namespace content { | 19 namespace content { |
17 | 20 |
18 // Provides gamepad data and events for blink. | 21 // Provides gamepad data and events for blink. |
19 class RendererGamepadProvider | 22 class RendererGamepadProvider |
20 : public PlatformEventObserver<blink::WebGamepadListener> { | 23 : public PlatformEventObserver<blink::WebGamepadListener> { |
21 public: | 24 public: |
22 explicit RendererGamepadProvider(RenderThread* thread) | 25 explicit RendererGamepadProvider(RenderThread* thread) |
23 : PlatformEventObserver<blink::WebGamepadListener>(thread) { } | 26 : PlatformEventObserver<blink::WebGamepadListener>(thread) { } |
24 | 27 |
25 ~RendererGamepadProvider() override {} | 28 ~RendererGamepadProvider() override {} |
26 | 29 |
27 // Provides latest snapshot of gamepads. | 30 // Provides latest snapshot of gamepads. |
28 virtual void SampleGamepads(blink::WebGamepads& gamepads) = 0; | 31 virtual void SampleGamepads(device::Gamepads& gamepads) = 0; |
29 | 32 |
30 protected: | 33 protected: |
31 DISALLOW_COPY_AND_ASSIGN(RendererGamepadProvider); | 34 DISALLOW_COPY_AND_ASSIGN(RendererGamepadProvider); |
32 }; | 35 }; |
33 | 36 |
34 } // namespace content | 37 } // namespace content |
35 | 38 |
36 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_GAMEPAD_PROVIDER_H_ | 39 #endif // CONTENT_PUBLIC_RENDERER_RENDERER_GAMEPAD_PROVIDER_H_ |
OLD | NEW |