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 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
167 const AtomicString& eventName = gamepad->connected() ? EventTypeNames::gamep
adconnected : EventTypeNames::gamepaddisconnected; | 167 const AtomicString& eventName = gamepad->connected() ? EventTypeNames::gamep
adconnected : EventTypeNames::gamepaddisconnected; |
168 window()->dispatchEvent(GamepadEvent::create(eventName, false, true, gamepad
)); | 168 window()->dispatchEvent(GamepadEvent::create(eventName, false, true, gamepad
)); |
169 | 169 |
170 if (!m_pendingEvents.isEmpty()) | 170 if (!m_pendingEvents.isEmpty()) |
171 m_dispatchOneEventRunner.runAsync(); | 171 m_dispatchOneEventRunner.runAsync(); |
172 } | 172 } |
173 | 173 |
174 NavigatorGamepad::NavigatorGamepad(LocalFrame* frame) | 174 NavigatorGamepad::NavigatorGamepad(LocalFrame* frame) |
175 : DOMWindowProperty(frame) | 175 : DOMWindowProperty(frame) |
176 , PlatformEventController(frame ? frame->page() : 0) | 176 , PlatformEventController(frame ? frame->page() : 0) |
177 , DOMWindowLifecycleObserver(frame ? frame->domWindow() : 0) | 177 , DOMWindowLifecycleObserver(frame ? frame->localDOMWindow() : 0) |
178 , m_dispatchOneEventRunner(this, &NavigatorGamepad::dispatchOneEvent) | 178 , m_dispatchOneEventRunner(this, &NavigatorGamepad::dispatchOneEvent) |
179 { | 179 { |
180 } | 180 } |
181 | 181 |
182 NavigatorGamepad::~NavigatorGamepad() | 182 NavigatorGamepad::~NavigatorGamepad() |
183 { | 183 { |
184 } | 184 } |
185 | 185 |
186 const char* NavigatorGamepad::supplementName() | 186 const char* NavigatorGamepad::supplementName() |
187 { | 187 { |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
285 if (connectedGamepadChanged || (!oldWasConnected && newIsConnected)) { | 285 if (connectedGamepadChanged || (!oldWasConnected && newIsConnected)) { |
286 m_pendingEvents.append(newGamepad); | 286 m_pendingEvents.append(newGamepad); |
287 } | 287 } |
288 } | 288 } |
289 | 289 |
290 if (!m_pendingEvents.isEmpty()) | 290 if (!m_pendingEvents.isEmpty()) |
291 m_dispatchOneEventRunner.runAsync(); | 291 m_dispatchOneEventRunner.runAsync(); |
292 } | 292 } |
293 | 293 |
294 } // namespace blink | 294 } // namespace blink |
OLD | NEW |