| 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 updateEventHandlerInternal(RemoveAll, handlerClass, &target); | 206 updateEventHandlerInternal(RemoveAll, handlerClass, &target); |
| 207 } | 207 } |
| 208 } | 208 } |
| 209 | 209 |
| 210 void EventHandlerRegistry::notifyHasHandlersChanged( | 210 void EventHandlerRegistry::notifyHasHandlersChanged( |
| 211 LocalFrame* frame, | 211 LocalFrame* frame, |
| 212 EventHandlerClass handlerClass, | 212 EventHandlerClass handlerClass, |
| 213 bool hasActiveHandlers) { | 213 bool hasActiveHandlers) { |
| 214 switch (handlerClass) { | 214 switch (handlerClass) { |
| 215 case ScrollEvent: | 215 case ScrollEvent: |
| 216 m_frameHost->chromeClient().setHasScrollEventHandlers(frame, | 216 m_frameHost->page().chromeClient().setHasScrollEventHandlers( |
| 217 hasActiveHandlers); | 217 frame, hasActiveHandlers); |
| 218 break; | 218 break; |
| 219 case WheelEventBlocking: | 219 case WheelEventBlocking: |
| 220 case WheelEventPassive: | 220 case WheelEventPassive: |
| 221 m_frameHost->chromeClient().setEventListenerProperties( | 221 m_frameHost->page().chromeClient().setEventListenerProperties( |
| 222 frame, WebEventListenerClass::MouseWheel, | 222 frame, WebEventListenerClass::MouseWheel, |
| 223 webEventListenerProperties(hasEventHandlers(WheelEventBlocking), | 223 webEventListenerProperties(hasEventHandlers(WheelEventBlocking), |
| 224 hasEventHandlers(WheelEventPassive))); | 224 hasEventHandlers(WheelEventPassive))); |
| 225 break; | 225 break; |
| 226 case TouchStartOrMoveEventBlocking: | 226 case TouchStartOrMoveEventBlocking: |
| 227 case TouchStartOrMoveEventPassive: | 227 case TouchStartOrMoveEventPassive: |
| 228 m_frameHost->chromeClient().setEventListenerProperties( | 228 m_frameHost->page().chromeClient().setEventListenerProperties( |
| 229 frame, WebEventListenerClass::TouchStartOrMove, | 229 frame, WebEventListenerClass::TouchStartOrMove, |
| 230 webEventListenerProperties( | 230 webEventListenerProperties( |
| 231 hasEventHandlers(TouchStartOrMoveEventBlocking), | 231 hasEventHandlers(TouchStartOrMoveEventBlocking), |
| 232 hasEventHandlers(TouchStartOrMoveEventPassive))); | 232 hasEventHandlers(TouchStartOrMoveEventPassive))); |
| 233 break; | 233 break; |
| 234 case TouchEndOrCancelEventBlocking: | 234 case TouchEndOrCancelEventBlocking: |
| 235 case TouchEndOrCancelEventPassive: | 235 case TouchEndOrCancelEventPassive: |
| 236 m_frameHost->chromeClient().setEventListenerProperties( | 236 m_frameHost->page().chromeClient().setEventListenerProperties( |
| 237 frame, WebEventListenerClass::TouchEndOrCancel, | 237 frame, WebEventListenerClass::TouchEndOrCancel, |
| 238 webEventListenerProperties( | 238 webEventListenerProperties( |
| 239 hasEventHandlers(TouchEndOrCancelEventBlocking), | 239 hasEventHandlers(TouchEndOrCancelEventBlocking), |
| 240 hasEventHandlers(TouchEndOrCancelEventPassive))); | 240 hasEventHandlers(TouchEndOrCancelEventPassive))); |
| 241 break; | 241 break; |
| 242 #if DCHECK_IS_ON() | 242 #if DCHECK_IS_ON() |
| 243 case EventsForTesting: | 243 case EventsForTesting: |
| 244 break; | 244 break; |
| 245 #endif | 245 #endif |
| 246 default: | 246 default: |
| (...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 326 // its handlers properly. | 326 // its handlers properly. |
| 327 DCHECK(window->frame()); | 327 DCHECK(window->frame()); |
| 328 DCHECK(window->frame()->host()); | 328 DCHECK(window->frame()->host()); |
| 329 DCHECK(window->frame()->host() == m_frameHost); | 329 DCHECK(window->frame()->host() == m_frameHost); |
| 330 } | 330 } |
| 331 } | 331 } |
| 332 #endif // DCHECK_IS_ON() | 332 #endif // DCHECK_IS_ON() |
| 333 } | 333 } |
| 334 | 334 |
| 335 } // namespace blink | 335 } // namespace blink |
| OLD | NEW |