| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/frame/DeviceSingleWindowEventController.h" | 5 #include "core/frame/DeviceSingleWindowEventController.h" |
| 6 | 6 |
| 7 #include "core/dom/Document.h" | 7 #include "core/dom/Document.h" |
| 8 #include "core/events/Event.h" | 8 #include "core/events/Event.h" |
| 9 #include "core/frame/LocalDOMWindow.h" | 9 #include "core/frame/LocalDOMWindow.h" |
| 10 #include "core/page/Page.h" | 10 #include "core/page/Page.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 | 21 |
| 22 DeviceSingleWindowEventController::~DeviceSingleWindowEventController() | 22 DeviceSingleWindowEventController::~DeviceSingleWindowEventController() |
| 23 { | 23 { |
| 24 } | 24 } |
| 25 | 25 |
| 26 void DeviceSingleWindowEventController::didUpdateData() | 26 void DeviceSingleWindowEventController::didUpdateData() |
| 27 { | 27 { |
| 28 dispatchDeviceEvent(lastEvent()); | 28 dispatchDeviceEvent(lastEvent()); |
| 29 } | 29 } |
| 30 | 30 |
| 31 void DeviceSingleWindowEventController::dispatchDeviceEvent(PassRefPtrWillBeRawP
tr<Event> prpEvent) | 31 void DeviceSingleWindowEventController::dispatchDeviceEvent(RawPtr<Event> prpEve
nt) |
| 32 { | 32 { |
| 33 if (!document().domWindow() || document().activeDOMObjectsAreSuspended() ||
document().activeDOMObjectsAreStopped()) | 33 if (!document().domWindow() || document().activeDOMObjectsAreSuspended() ||
document().activeDOMObjectsAreStopped()) |
| 34 return; | 34 return; |
| 35 | 35 |
| 36 RefPtrWillBeRawPtr<Event> event = prpEvent; | 36 RawPtr<Event> event = prpEvent; |
| 37 document().domWindow()->dispatchEvent(event); | 37 document().domWindow()->dispatchEvent(event); |
| 38 | 38 |
| 39 if (m_needsCheckingNullEvents) { | 39 if (m_needsCheckingNullEvents) { |
| 40 if (isNullEvent(event.get())) | 40 if (isNullEvent(event.get())) |
| 41 stopUpdating(); | 41 stopUpdating(); |
| 42 else | 42 else |
| 43 m_needsCheckingNullEvents = false; | 43 m_needsCheckingNullEvents = false; |
| 44 } | 44 } |
| 45 } | 45 } |
| 46 | 46 |
| (...skipping 24 matching lines...) Expand all Loading... |
| 71 } | 71 } |
| 72 | 72 |
| 73 DEFINE_TRACE(DeviceSingleWindowEventController) | 73 DEFINE_TRACE(DeviceSingleWindowEventController) |
| 74 { | 74 { |
| 75 visitor->trace(m_document); | 75 visitor->trace(m_document); |
| 76 PlatformEventController::trace(visitor); | 76 PlatformEventController::trace(visitor); |
| 77 DOMWindowLifecycleObserver::trace(visitor); | 77 DOMWindowLifecycleObserver::trace(visitor); |
| 78 } | 78 } |
| 79 | 79 |
| 80 } // namespace blink | 80 } // namespace blink |
| OLD | NEW |