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/EventHandlerRegistry.h" | 5 #include "core/frame/EventHandlerRegistry.h" |
6 | 6 |
7 #include "core/events/EventListenerOptions.h" | 7 #include "core/events/EventListenerOptions.h" |
8 #include "core/events/EventUtil.h" | 8 #include "core/events/EventUtil.h" |
9 #include "core/frame/LocalDOMWindow.h" | 9 #include "core/frame/LocalDOMWindow.h" |
10 #include "core/frame/LocalFrame.h" | 10 #include "core/frame/LocalFrame.h" |
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 FrameHost* oldFrameHost, | 191 FrameHost* oldFrameHost, |
192 FrameHost* newFrameHost) { | 192 FrameHost* newFrameHost) { |
193 ASSERT(newFrameHost != oldFrameHost); | 193 ASSERT(newFrameHost != oldFrameHost); |
194 for (size_t i = 0; i < EventHandlerClassCount; ++i) { | 194 for (size_t i = 0; i < EventHandlerClassCount; ++i) { |
195 EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i); | 195 EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i); |
196 const EventTargetSet* targets = | 196 const EventTargetSet* targets = |
197 &oldFrameHost->eventHandlerRegistry().m_targets[handlerClass]; | 197 &oldFrameHost->eventHandlerRegistry().m_targets[handlerClass]; |
198 for (unsigned count = targets->count(&target); count > 0; --count) | 198 for (unsigned count = targets->count(&target); count > 0; --count) |
199 newFrameHost->eventHandlerRegistry().didAddEventHandler(target, | 199 newFrameHost->eventHandlerRegistry().didAddEventHandler(target, |
200 handlerClass); | 200 handlerClass); |
201 oldFrameHost->eventHandlerRegistry().didRemoveAllEventHandlers(target); | |
202 } | 201 } |
| 202 oldFrameHost->eventHandlerRegistry().didRemoveAllEventHandlers(target); |
203 } | 203 } |
204 | 204 |
205 void EventHandlerRegistry::didRemoveAllEventHandlers(EventTarget& target) { | 205 void EventHandlerRegistry::didRemoveAllEventHandlers(EventTarget& target) { |
206 for (size_t i = 0; i < EventHandlerClassCount; ++i) { | 206 for (size_t i = 0; i < EventHandlerClassCount; ++i) { |
207 EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i); | 207 EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i); |
208 updateEventHandlerInternal(RemoveAll, handlerClass, &target); | 208 updateEventHandlerInternal(RemoveAll, handlerClass, &target); |
209 } | 209 } |
210 } | 210 } |
211 | 211 |
212 void EventHandlerRegistry::notifyHasHandlersChanged( | 212 void EventHandlerRegistry::notifyHasHandlersChanged( |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
328 ASSERT(window->frame()); | 328 ASSERT(window->frame()); |
329 ASSERT(window->frame()->host()); | 329 ASSERT(window->frame()->host()); |
330 ASSERT(window->frame()->host() == m_frameHost); | 330 ASSERT(window->frame()->host() == m_frameHost); |
331 } | 331 } |
332 } | 332 } |
333 } | 333 } |
334 #endif // ENABLE(ASSERT) | 334 #endif // ENABLE(ASSERT) |
335 } | 335 } |
336 | 336 |
337 } // namespace blink | 337 } // namespace blink |
OLD | NEW |