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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 didAddEventHandler(target, handlerClass); | 181 didAddEventHandler(target, handlerClass); |
182 } | 182 } |
183 } | 183 } |
184 } | 184 } |
185 | 185 |
186 void EventHandlerRegistry::didMoveOutOfFrameHost(EventTarget& target) { | 186 void EventHandlerRegistry::didMoveOutOfFrameHost(EventTarget& target) { |
187 didRemoveAllEventHandlers(target); | 187 didRemoveAllEventHandlers(target); |
188 } | 188 } |
189 | 189 |
190 void EventHandlerRegistry::didMoveBetweenFrameHosts(EventTarget& target, | |
191 FrameHost* oldFrameHost, | |
192 FrameHost* newFrameHost) { | |
193 ASSERT(newFrameHost != oldFrameHost); | |
194 oldFrameHost->eventHandlerRegistry().didMoveOutOfFrameHost(target); | |
195 newFrameHost->eventHandlerRegistry().didMoveIntoFrameHost(target); | |
196 } | |
197 | |
198 void EventHandlerRegistry::didRemoveAllEventHandlers(EventTarget& target) { | 190 void EventHandlerRegistry::didRemoveAllEventHandlers(EventTarget& target) { |
199 for (size_t i = 0; i < EventHandlerClassCount; ++i) { | 191 for (size_t i = 0; i < EventHandlerClassCount; ++i) { |
200 EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i); | 192 EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i); |
201 updateEventHandlerInternal(RemoveAll, handlerClass, &target); | 193 updateEventHandlerInternal(RemoveAll, handlerClass, &target); |
202 } | 194 } |
203 } | 195 } |
204 | 196 |
205 void EventHandlerRegistry::notifyHasHandlersChanged( | 197 void EventHandlerRegistry::notifyHasHandlersChanged( |
206 EventHandlerClass handlerClass, | 198 EventHandlerClass handlerClass, |
207 bool hasActiveHandlers) { | 199 bool hasActiveHandlers) { |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
321 ASSERT(window->frame()); | 313 ASSERT(window->frame()); |
322 ASSERT(window->frame()->host()); | 314 ASSERT(window->frame()->host()); |
323 ASSERT(window->frame()->host() == m_frameHost); | 315 ASSERT(window->frame()->host() == m_frameHost); |
324 } | 316 } |
325 } | 317 } |
326 } | 318 } |
327 #endif // ENABLE(ASSERT) | 319 #endif // ENABLE(ASSERT) |
328 } | 320 } |
329 | 321 |
330 } // namespace blink | 322 } // namespace blink |
OLD | NEW |