OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 3 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 4 // found in the LICENSE file. |
4 | 5 |
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_ | 6 #ifndef CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_ |
6 #define CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_ | 7 #define CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_ |
7 | 8 |
8 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
9 #include "base/memory/shared_memory.h" | 10 #include "base/memory/shared_memory.h" |
10 #include "content/public/browser/browser_message_filter.h" | 11 #include "content/public/browser/browser_message_filter.h" |
11 | 12 |
12 namespace content { | 13 namespace content { |
13 | 14 |
14 class GamepadService; | 15 class GamepadService; |
15 class RenderProcessHost; | 16 class RenderProcessHost; |
16 | 17 |
17 class GamepadBrowserMessageFilter : public BrowserMessageFilter { | 18 class GamepadBrowserMessageFilter : public BrowserMessageFilter { |
18 public: | 19 public: |
19 GamepadBrowserMessageFilter(); | 20 GamepadBrowserMessageFilter(); |
20 | 21 |
21 // BrowserMessageFilter implementation. | 22 // BrowserMessageFilter implementation. |
22 virtual bool OnMessageReceived(const IPC::Message& message, | 23 virtual bool OnMessageReceived(const IPC::Message& message, |
23 bool* message_was_ok) OVERRIDE; | 24 bool* message_was_ok) OVERRIDE; |
24 | 25 |
25 private: | 26 private: |
26 virtual ~GamepadBrowserMessageFilter(); | 27 virtual ~GamepadBrowserMessageFilter(); |
27 | 28 |
28 void OnGamepadStartPolling(base::SharedMemoryHandle* renderer_handle); | 29 void OnGamepadStartPolling(base::SharedMemoryHandle* renderer_handle); |
29 void OnGamepadStopPolling(); | 30 void OnGamepadStopPolling(); |
| 31 #if defined(OS_ANDROID) |
| 32 void OnGamepadResumePolling(); |
| 33 void OnGamepadPausePolling(); |
| 34 void OnGamepadUpdateTimestamp(); |
| 35 #endif |
30 | 36 |
31 bool is_started_; | 37 bool is_started_; |
32 | 38 |
33 DISALLOW_COPY_AND_ASSIGN(GamepadBrowserMessageFilter); | 39 DISALLOW_COPY_AND_ASSIGN(GamepadBrowserMessageFilter); |
34 }; | 40 }; |
35 | 41 |
36 } // namespace content | 42 } // namespace content |
37 | 43 |
38 #endif // CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_ | 44 #endif // CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_ |
OLD | NEW |