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" | 9 #include "wtf/TemporaryChange.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 GamepadDispatcher& GamepadDispatcher::instance() | 13 GamepadDispatcher& GamepadDispatcher::instance() |
14 { | 14 { |
15 DEFINE_STATIC_LOCAL(Persistent<GamepadDispatcher>, gamepadDispatcher, (new G
amepadDispatcher())); | 15 DEFINE_STATIC_LOCAL(GamepadDispatcher, gamepadDispatcher, (new GamepadDispat
cher)); |
16 return *gamepadDispatcher; | 16 return gamepadDispatcher; |
17 } | 17 } |
18 | 18 |
19 void GamepadDispatcher::sampleGamepads(WebGamepads& gamepads) | 19 void GamepadDispatcher::sampleGamepads(WebGamepads& gamepads) |
20 { | 20 { |
21 Platform::current()->sampleGamepads(gamepads); | 21 Platform::current()->sampleGamepads(gamepads); |
22 } | 22 } |
23 | 23 |
24 GamepadDispatcher::GamepadDispatcher() | 24 GamepadDispatcher::GamepadDispatcher() |
25 { | 25 { |
26 } | 26 } |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 { | 58 { |
59 Platform::current()->startListening(WebPlatformEventTypeGamepad, this); | 59 Platform::current()->startListening(WebPlatformEventTypeGamepad, this); |
60 } | 60 } |
61 | 61 |
62 void GamepadDispatcher::stopListening() | 62 void GamepadDispatcher::stopListening() |
63 { | 63 { |
64 Platform::current()->stopListening(WebPlatformEventTypeGamepad); | 64 Platform::current()->stopListening(WebPlatformEventTypeGamepad); |
65 } | 65 } |
66 | 66 |
67 } // namespace blink | 67 } // namespace blink |
OLD | NEW |