| 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 #include "config.h" | 5 #include "config.h" |
| 6 #include "modules/gamepad/GamepadDispatcher.h" | 6 #include "modules/gamepad/GamepadDispatcher.h" |
| 7 | 7 |
| 8 #include "modules/gamepad/NavigatorGamepad.h" | 8 #include "modules/gamepad/NavigatorGamepad.h" |
| 9 #include "public/platform/Platform.h" | 9 #include "public/platform/Platform.h" |
| 10 #include "wtf/TemporaryChange.h" | 10 #include "wtf/TemporaryChange.h" |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 ASSERT(index < blink::WebGamepads::itemsLengthCap); | 45 ASSERT(index < blink::WebGamepads::itemsLengthCap); |
| 46 ASSERT(connected == gamepad.connected); | 46 ASSERT(connected == gamepad.connected); |
| 47 | 47 |
| 48 m_latestChange.pad = gamepad; | 48 m_latestChange.pad = gamepad; |
| 49 m_latestChange.index = index; | 49 m_latestChange.index = index; |
| 50 notifyControllers(); | 50 notifyControllers(); |
| 51 } | 51 } |
| 52 | 52 |
| 53 void GamepadDispatcher::startListening() | 53 void GamepadDispatcher::startListening() |
| 54 { | 54 { |
| 55 blink::Platform::current()->setGamepadListener(this); | 55 blink::Platform::current()->startListening(WebPlatformEventGamepad, this); |
| 56 } | 56 } |
| 57 | 57 |
| 58 void GamepadDispatcher::stopListening() | 58 void GamepadDispatcher::stopListening() |
| 59 { | 59 { |
| 60 blink::Platform::current()->setGamepadListener(0); | 60 blink::Platform::current()->stopListening(WebPlatformEventGamepad); |
| 61 } | 61 } |
| 62 | 62 |
| 63 } // namespace blink | 63 } // namespace blink |
| OLD | NEW |