OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2011, Google Inc. All rights reserved. | 2 * Copyright (C) 2011, Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are met: | 5 * modification, are permitted provided that the following conditions are met: |
6 * | 6 * |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "core/frame/LocalDOMWindow.h" | 30 #include "core/frame/LocalDOMWindow.h" |
31 #include "core/frame/LocalFrame.h" | 31 #include "core/frame/LocalFrame.h" |
32 #include "core/frame/Navigator.h" | 32 #include "core/frame/Navigator.h" |
33 #include "core/page/Page.h" | 33 #include "core/page/Page.h" |
34 #include "modules/gamepad/GamepadDispatcher.h" | 34 #include "modules/gamepad/GamepadDispatcher.h" |
35 #include "modules/gamepad/GamepadEvent.h" | 35 #include "modules/gamepad/GamepadEvent.h" |
36 #include "modules/gamepad/GamepadList.h" | 36 #include "modules/gamepad/GamepadList.h" |
37 #include "modules/gamepad/WebKitGamepadList.h" | 37 #include "modules/gamepad/WebKitGamepadList.h" |
38 #include "platform/RuntimeEnabledFeatures.h" | 38 #include "platform/RuntimeEnabledFeatures.h" |
39 | 39 |
40 namespace WebCore { | 40 namespace blink { |
41 | 41 |
42 template<typename T> | 42 template<typename T> |
43 static void sampleGamepad(unsigned index, T& gamepad, const blink::WebGamepad& w
ebGamepad) | 43 static void sampleGamepad(unsigned index, T& gamepad, const blink::WebGamepad& w
ebGamepad) |
44 { | 44 { |
45 gamepad.setId(webGamepad.id); | 45 gamepad.setId(webGamepad.id); |
46 gamepad.setIndex(index); | 46 gamepad.setIndex(index); |
47 gamepad.setConnected(webGamepad.connected); | 47 gamepad.setConnected(webGamepad.connected); |
48 gamepad.setTimestamp(webGamepad.timestamp); | 48 gamepad.setTimestamp(webGamepad.timestamp); |
49 gamepad.setMapping(webGamepad.mapping); | 49 gamepad.setMapping(webGamepad.mapping); |
50 gamepad.setAxes(webGamepad.axesLength, webGamepad.axes); | 50 gamepad.setAxes(webGamepad.axesLength, webGamepad.axes); |
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 } | 283 } |
284 if (connectedGamepadChanged || (!oldWasConnected && newIsConnected)) { | 284 if (connectedGamepadChanged || (!oldWasConnected && newIsConnected)) { |
285 m_pendingEvents.append(newGamepad); | 285 m_pendingEvents.append(newGamepad); |
286 } | 286 } |
287 } | 287 } |
288 | 288 |
289 if (!m_pendingEvents.isEmpty()) | 289 if (!m_pendingEvents.isEmpty()) |
290 m_dispatchOneEventRunner.runAsync(); | 290 m_dispatchOneEventRunner.runAsync(); |
291 } | 291 } |
292 | 292 |
293 } // namespace WebCore | 293 } // namespace blink |
OLD | NEW |