| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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 GamepadDispatcher_h | 5 #ifndef GamepadDispatcher_h |
| 6 #define GamepadDispatcher_h | 6 #define GamepadDispatcher_h |
| 7 | 7 |
| 8 #include "core/frame/DeviceEventDispatcherBase.h" | 8 #include "core/frame/DeviceEventDispatcherBase.h" |
| 9 #include "platform/heap/Handle.h" | 9 #include "platform/heap/Handle.h" |
| 10 #include "public/platform/WebGamepad.h" | 10 #include "public/platform/WebGamepad.h" |
| 11 #include "public/platform/WebGamepadListener.h" | 11 #include "public/platform/WebGamepadListener.h" |
| 12 | 12 |
| 13 namespace blink { | 13 namespace blink { |
| 14 class WebGamepads; | 14 class WebGamepads; |
| 15 } | 15 } |
| 16 | 16 |
| 17 namespace WebCore { | 17 namespace blink { |
| 18 | 18 |
| 19 class NavigatorGamepad; | 19 class NavigatorGamepad; |
| 20 | 20 |
| 21 class GamepadDispatcher : public DeviceEventDispatcherBase, public blink::WebGam
epadListener { | 21 class GamepadDispatcher : public DeviceEventDispatcherBase, public blink::WebGam
epadListener { |
| 22 public: | 22 public: |
| 23 static GamepadDispatcher& instance(); | 23 static GamepadDispatcher& instance(); |
| 24 | 24 |
| 25 void sampleGamepads(blink::WebGamepads&); | 25 void sampleGamepads(blink::WebGamepads&); |
| 26 | 26 |
| 27 struct ConnectionChange { | 27 struct ConnectionChange { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 41 | 41 |
| 42 // DeviceEventDispatcherBase | 42 // DeviceEventDispatcherBase |
| 43 virtual void startListening() OVERRIDE; | 43 virtual void startListening() OVERRIDE; |
| 44 virtual void stopListening() OVERRIDE; | 44 virtual void stopListening() OVERRIDE; |
| 45 | 45 |
| 46 void dispatchDidConnectOrDisconnectGamepad(unsigned index, const blink::WebG
amepad&, bool connected); | 46 void dispatchDidConnectOrDisconnectGamepad(unsigned index, const blink::WebG
amepad&, bool connected); |
| 47 | 47 |
| 48 ConnectionChange m_latestChange; | 48 ConnectionChange m_latestChange; |
| 49 }; | 49 }; |
| 50 | 50 |
| 51 } // namespace WebCore | 51 } // namespace blink |
| 52 | 52 |
| 53 #endif | 53 #endif |
| OLD | NEW |