| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/shared_memory.h" |
| 10 #include "content/browser/browser_message_filter.h" | 11 #include "content/browser/browser_message_filter.h" |
| 11 #include "content/browser/gamepad/gamepad_provider.h" | 12 |
| 13 namespace content { |
| 14 |
| 15 class GamepadService; |
| 16 class RenderProcessHost; |
| 12 | 17 |
| 13 class GamepadBrowserMessageFilter : public BrowserMessageFilter { | 18 class GamepadBrowserMessageFilter : public BrowserMessageFilter { |
| 14 public: | 19 public: |
| 20 GamepadBrowserMessageFilter(RenderProcessHost* rph); |
| 21 |
| 15 // BrowserMessageFilter implementation. | 22 // BrowserMessageFilter implementation. |
| 16 virtual bool OnMessageReceived(const IPC::Message& message, | 23 virtual bool OnMessageReceived(const IPC::Message& message, |
| 17 bool* message_was_ok) OVERRIDE; | 24 bool* message_was_ok) OVERRIDE; |
| 18 GamepadBrowserMessageFilter(); | 25 GamepadBrowserMessageFilter(); |
| 19 | 26 |
| 20 private: | 27 private: |
| 21 virtual ~GamepadBrowserMessageFilter(); | 28 virtual ~GamepadBrowserMessageFilter(); |
| 22 | 29 |
| 23 void OnGamepadStartPolling(base::SharedMemoryHandle* renderer_handle); | 30 void OnGamepadStartPolling(base::SharedMemoryHandle* renderer_handle); |
| 24 void OnGamepadStopPolling(); | 31 void OnGamepadStopPolling(); |
| 25 | 32 |
| 26 scoped_refptr<content::GamepadProvider> provider_; | 33 GamepadService* gamepad_service_; |
| 34 RenderProcessHost* render_process_host_; |
| 27 | 35 |
| 28 DISALLOW_COPY_AND_ASSIGN(GamepadBrowserMessageFilter); | 36 DISALLOW_COPY_AND_ASSIGN(GamepadBrowserMessageFilter); |
| 29 }; | 37 }; |
| 30 | 38 |
| 39 } // namespace content |
| 40 |
| 31 #endif // CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_ | 41 #endif // CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_ |
| OLD | NEW |