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 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 NavigatorGamepad::~NavigatorGamepad() {} | 179 NavigatorGamepad::~NavigatorGamepad() {} |
180 | 180 |
181 const char* NavigatorGamepad::supplementName() { | 181 const char* NavigatorGamepad::supplementName() { |
182 return "NavigatorGamepad"; | 182 return "NavigatorGamepad"; |
183 } | 183 } |
184 | 184 |
185 void NavigatorGamepad::contextDestroyed(ExecutionContext*) { | 185 void NavigatorGamepad::contextDestroyed(ExecutionContext*) { |
186 stopUpdating(); | 186 stopUpdating(); |
187 } | 187 } |
188 | 188 |
189 void NavigatorGamepad::contextDestroyed(Page*) {} | |
190 | |
191 void NavigatorGamepad::registerWithDispatcher() { | 189 void NavigatorGamepad::registerWithDispatcher() { |
192 GamepadDispatcher::instance().addController(this); | 190 GamepadDispatcher::instance().addController(this); |
193 m_dispatchOneEventRunner->resume(); | 191 m_dispatchOneEventRunner->resume(); |
194 } | 192 } |
195 | 193 |
196 void NavigatorGamepad::unregisterWithDispatcher() { | 194 void NavigatorGamepad::unregisterWithDispatcher() { |
197 m_dispatchOneEventRunner->suspend(); | 195 m_dispatchOneEventRunner->suspend(); |
198 GamepadDispatcher::instance().removeController(this); | 196 GamepadDispatcher::instance().removeController(this); |
199 } | 197 } |
200 | 198 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 if (connectedGamepadChanged || (!oldWasConnected && newIsConnected)) { | 266 if (connectedGamepadChanged || (!oldWasConnected && newIsConnected)) { |
269 m_pendingEvents.append(newGamepad); | 267 m_pendingEvents.append(newGamepad); |
270 } | 268 } |
271 } | 269 } |
272 | 270 |
273 if (!m_pendingEvents.isEmpty()) | 271 if (!m_pendingEvents.isEmpty()) |
274 m_dispatchOneEventRunner->runAsync(); | 272 m_dispatchOneEventRunner->runAsync(); |
275 } | 273 } |
276 | 274 |
277 } // namespace blink | 275 } // namespace blink |
OLD | NEW |