| 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 #ifndef CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_ | 5 #ifndef CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_ |
| 6 #define CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_ | 6 #define CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/memory/shared_memory.h" | 9 #include "base/memory/shared_memory.h" |
| 10 #include "content/browser/gamepad/gamepad_consumer.h" | 10 #include "content/browser/gamepad/gamepad_consumer.h" |
| 11 #include "content/public/browser/browser_message_filter.h" | 11 #include "content/public/browser/browser_message_filter.h" |
| 12 | 12 |
| 13 namespace content { | 13 namespace content { |
| 14 | 14 |
| 15 class GamepadService; | 15 class GamepadService; |
| 16 class RenderProcessHost; | 16 class RenderProcessHost; |
| 17 | 17 |
| 18 class GamepadBrowserMessageFilter : | 18 class GamepadBrowserMessageFilter : |
| 19 public BrowserMessageFilter, | 19 public BrowserMessageFilter, |
| 20 public GamepadConsumer { | 20 public GamepadConsumer { |
| 21 public: | 21 public: |
| 22 GamepadBrowserMessageFilter(); | 22 GamepadBrowserMessageFilter(); |
| 23 | 23 |
| 24 // BrowserMessageFilter implementation. | 24 // BrowserMessageFilter implementation. |
| 25 virtual bool OnMessageReceived(const IPC::Message& message, | 25 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 26 bool* message_was_ok) OVERRIDE; | |
| 27 | 26 |
| 28 // GamepadConsumer implementation. | 27 // GamepadConsumer implementation. |
| 29 virtual void OnGamepadConnected( | 28 virtual void OnGamepadConnected( |
| 30 unsigned index, | 29 unsigned index, |
| 31 const blink::WebGamepad& gamepad) OVERRIDE; | 30 const blink::WebGamepad& gamepad) OVERRIDE; |
| 32 virtual void OnGamepadDisconnected( | 31 virtual void OnGamepadDisconnected( |
| 33 unsigned index, | 32 unsigned index, |
| 34 const blink::WebGamepad& gamepad) OVERRIDE; | 33 const blink::WebGamepad& gamepad) OVERRIDE; |
| 35 | 34 |
| 36 private: | 35 private: |
| 37 virtual ~GamepadBrowserMessageFilter(); | 36 virtual ~GamepadBrowserMessageFilter(); |
| 38 | 37 |
| 39 void OnGamepadStartPolling(base::SharedMemoryHandle* renderer_handle); | 38 void OnGamepadStartPolling(base::SharedMemoryHandle* renderer_handle); |
| 40 void OnGamepadStopPolling(); | 39 void OnGamepadStopPolling(); |
| 41 | 40 |
| 42 bool is_started_; | 41 bool is_started_; |
| 43 | 42 |
| 44 DISALLOW_COPY_AND_ASSIGN(GamepadBrowserMessageFilter); | 43 DISALLOW_COPY_AND_ASSIGN(GamepadBrowserMessageFilter); |
| 45 }; | 44 }; |
| 46 | 45 |
| 47 } // namespace content | 46 } // namespace content |
| 48 | 47 |
| 49 #endif // CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_ | 48 #endif // CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_ |
| OLD | NEW |