Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(162)

Side by Side Diff: content/browser/renderer_host/gamepad_browser_message_filter.h

Issue 200873002: Gamepad API: add support for connection events (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/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 :
19 public BrowserMessageFilter,
20 public GamepadConsumer {
18 public: 21 public:
19 GamepadBrowserMessageFilter(); 22 GamepadBrowserMessageFilter(IPC::Sender* sender);
20 23
21 // BrowserMessageFilter implementation. 24 // BrowserMessageFilter implementation.
22 virtual bool OnMessageReceived(const IPC::Message& message, 25 virtual bool OnMessageReceived(const IPC::Message& message,
23 bool* message_was_ok) OVERRIDE; 26 bool* message_was_ok) OVERRIDE;
24 27
28 virtual void OnGamepadConnected(
29 unsigned index,
30 const blink::WebGamepad& web_gamepad) OVERRIDE;
31 virtual void OnGamepadDisconnected(
32 unsigned index,
33 const blink::WebGamepad& web_gamepad) OVERRIDE;
34
25 private: 35 private:
26 virtual ~GamepadBrowserMessageFilter(); 36 virtual ~GamepadBrowserMessageFilter();
27 37
28 void OnGamepadStartPolling(base::SharedMemoryHandle* renderer_handle); 38 void OnGamepadStartPolling(base::SharedMemoryHandle* renderer_handle);
29 void OnGamepadStopPolling(); 39 void OnGamepadStopPolling();
30 40
41 IPC::Sender* sender_;
31 bool is_started_; 42 bool is_started_;
32 43
33 DISALLOW_COPY_AND_ASSIGN(GamepadBrowserMessageFilter); 44 DISALLOW_COPY_AND_ASSIGN(GamepadBrowserMessageFilter);
34 }; 45 };
35 46
36 } // namespace content 47 } // namespace content
37 48
38 #endif // CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_ 49 #endif // CONTENT_BROWSER_RENDERER_HOST_GAMEPAD_BROWSER_MESSAGE_FILTER_H_
OLDNEW
« no previous file with comments | « content/browser/gamepad/gamepad_service.cc ('k') | content/browser/renderer_host/gamepad_browser_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698