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 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 && !window->hasEventListeners(EventTypeNames::gamepaddisconnected)) { | 221 && !window->hasEventListeners(EventTypeNames::gamepaddisconnected)) { |
222 m_hasEventListener = false; | 222 m_hasEventListener = false; |
223 } | 223 } |
224 } | 224 } |
225 | 225 |
226 void NavigatorGamepad::didRemoveAllEventListeners(LocalDOMWindow*) | 226 void NavigatorGamepad::didRemoveAllEventListeners(LocalDOMWindow*) |
227 { | 227 { |
228 m_hasEventListener = false; | 228 m_hasEventListener = false; |
229 } | 229 } |
230 | 230 |
| 231 void NavigatorGamepad::pageVisibilityChanged() |
| 232 { |
| 233 // Inform the embedder whether it needs to provide gamepad data for us. |
| 234 if (page()->visibilityState() == PageVisibilityStateVisible && (m_hasEventLi
stener || m_gamepads || m_webkitGamepads)) |
| 235 startUpdating(); |
| 236 else |
| 237 stopUpdating(); |
| 238 } |
| 239 |
231 } // namespace WebCore | 240 } // namespace WebCore |
OLD | NEW |