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

Side by Side Diff: Source/modules/gamepad/GamepadDispatcher.h

Issue 200783002: Gamepad API: add support for gamepadconnected and gamepaddisconnected events (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: layout fix: webexposed/global-constructors-listing 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
« no previous file with comments | « Source/core/events/EventTypeNames.in ('k') | Source/modules/gamepad/GamepadDispatcher.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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.
4
5 #ifndef GamepadDispatcher_h
6 #define GamepadDispatcher_h
7
8 #include "core/frame/DeviceSensorEventDispatcher.h"
9 #include "public/platform/WebGamepadListener.h"
10
11 namespace blink {
12 class WebGamepad;
13 class WebGamepads;
14 }
15
16 namespace WebCore {
17
18 class NavigatorGamepad;
19
20 class GamepadDispatcher : public DeviceSensorEventDispatcher, public blink::WebG amepadListener {
21 public:
22 static GamepadDispatcher& instance();
23
24 void addClient(NavigatorGamepad*);
25 void removeClient(NavigatorGamepad*);
26 void sampleGamepads(blink::WebGamepads&);
27
28 private:
29 GamepadDispatcher();
30 virtual ~GamepadDispatcher();
31
32 virtual void didConnectGamepad(unsigned index, const blink::WebGamepad&) OVE RRIDE;
33 virtual void didDisconnectGamepad(unsigned index, const blink::WebGamepad&) OVERRIDE;
34 void dispatchDidConnectOrDisconnectGamepad(unsigned index, const blink::WebG amepad&, bool connected);
35
36 virtual void startListening() OVERRIDE;
37 virtual void stopListening() OVERRIDE;
38 };
39
40 } // namespace WebCore
41
42 #endif
OLDNEW
« no previous file with comments | « Source/core/events/EventTypeNames.in ('k') | Source/modules/gamepad/GamepadDispatcher.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698