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