| 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/PlatformEventDispatcher.h" | 8 #include "core/frame/PlatformEventDispatcher.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 | 14 |
| 15 class GamepadSharedMemoryReader; |
| 15 class WebGamepads; | 16 class WebGamepads; |
| 16 | 17 |
| 17 class GamepadDispatcher final | 18 class GamepadDispatcher final |
| 18 : public GarbageCollectedFinalized<GamepadDispatcher>, | 19 : public GarbageCollectedFinalized<GamepadDispatcher>, |
| 19 public PlatformEventDispatcher, | 20 public PlatformEventDispatcher, |
| 20 public WebGamepadListener { | 21 public WebGamepadListener { |
| 21 USING_GARBAGE_COLLECTED_MIXIN(GamepadDispatcher); | 22 USING_GARBAGE_COLLECTED_MIXIN(GamepadDispatcher); |
| 22 | 23 |
| 23 public: | 24 public: |
| 24 static GamepadDispatcher& instance(); | 25 static GamepadDispatcher& instance(); |
| (...skipping 22 matching lines...) Expand all Loading... |
| 47 | 48 |
| 48 // PlatformEventDispatcher | 49 // PlatformEventDispatcher |
| 49 void startListening() override; | 50 void startListening() override; |
| 50 void stopListening() override; | 51 void stopListening() override; |
| 51 | 52 |
| 52 void dispatchDidConnectOrDisconnectGamepad(unsigned index, | 53 void dispatchDidConnectOrDisconnectGamepad(unsigned index, |
| 53 const WebGamepad&, | 54 const WebGamepad&, |
| 54 bool connected); | 55 bool connected); |
| 55 | 56 |
| 56 ConnectionChange m_latestChange; | 57 ConnectionChange m_latestChange; |
| 58 std::unique_ptr<GamepadSharedMemoryReader> m_reader; |
| 57 }; | 59 }; |
| 58 | 60 |
| 59 } // namespace blink | 61 } // namespace blink |
| 60 | 62 |
| 61 #endif | 63 #endif |
| OLD | NEW |