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.
5 #ifndef CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_
8 #include "base/compiler_specific.h"
9 #include "base/memory/shared_memory.h"
10 #include "content/browser/gamepad/gamepad_consumer.h"
11 #include "content/public/browser/browser_message_filter.h"
16 class RenderProcessHost;
18 class GamepadBrowserMessageFilter :
19 public BrowserMessageFilter,
20 public GamepadConsumer {
22 GamepadBrowserMessageFilter();
24 // BrowserMessageFilter implementation.
25 bool OnMessageReceived(const IPC::Message& message) override;
27 // GamepadConsumer implementation.
28 void OnGamepadConnected(unsigned index,
29 const blink::WebGamepad& gamepad) override;
30 void OnGamepadDisconnected(unsigned index,
31 const blink::WebGamepad& gamepad) override;
34 ~GamepadBrowserMessageFilter() override;
36 void OnGamepadStartPolling(base::SharedMemoryHandle* renderer_handle);
37 void OnGamepadStopPolling();
41 DISALLOW_COPY_AND_ASSIGN(GamepadBrowserMessageFilter);
44 } // namespace content
46 #endif // CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_