| 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 "modules/gamepad/GamepadDispatcher.h" | 5 #include "modules/gamepad/GamepadDispatcher.h" |
| 6 | 6 |
| 7 #include "modules/gamepad/NavigatorGamepad.h" | 7 #include "modules/gamepad/NavigatorGamepad.h" |
| 8 #include "public/platform/Platform.h" | 8 #include "public/platform/Platform.h" |
| 9 #include "wtf/TemporaryChange.h" | |
| 10 | 9 |
| 11 namespace blink { | 10 namespace blink { |
| 12 | 11 |
| 13 GamepadDispatcher& GamepadDispatcher::instance() | 12 GamepadDispatcher& GamepadDispatcher::instance() |
| 14 { | 13 { |
| 15 DEFINE_STATIC_LOCAL(GamepadDispatcher, gamepadDispatcher, (new GamepadDispat
cher)); | 14 DEFINE_STATIC_LOCAL(GamepadDispatcher, gamepadDispatcher, (new GamepadDispat
cher)); |
| 16 return gamepadDispatcher; | 15 return gamepadDispatcher; |
| 17 } | 16 } |
| 18 | 17 |
| 19 void GamepadDispatcher::sampleGamepads(WebGamepads& gamepads) | 18 void GamepadDispatcher::sampleGamepads(WebGamepads& gamepads) |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 { | 57 { |
| 59 Platform::current()->startListening(WebPlatformEventTypeGamepad, this); | 58 Platform::current()->startListening(WebPlatformEventTypeGamepad, this); |
| 60 } | 59 } |
| 61 | 60 |
| 62 void GamepadDispatcher::stopListening() | 61 void GamepadDispatcher::stopListening() |
| 63 { | 62 { |
| 64 Platform::current()->stopListening(WebPlatformEventTypeGamepad); | 63 Platform::current()->stopListening(WebPlatformEventTypeGamepad); |
| 65 } | 64 } |
| 66 | 65 |
| 67 } // namespace blink | 66 } // namespace blink |
| OLD | NEW |