| 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 "config.h" | 5 #include "config.h" |
| 6 #include "core/frame/EventHandlerRegistry.h" | 6 #include "core/frame/EventHandlerRegistry.h" |
| 7 | 7 |
| 8 #include "core/events/ThreadLocalEventNames.h" | 8 #include "core/events/ThreadLocalEventNames.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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 157 void EventHandlerRegistry::didRemoveAllEventHandlers(EventTarget& target) | 157 void EventHandlerRegistry::didRemoveAllEventHandlers(EventTarget& target) |
| 158 { | 158 { |
| 159 for (size_t i = 0; i < EventHandlerClassCount; ++i) { | 159 for (size_t i = 0; i < EventHandlerClassCount; ++i) { |
| 160 EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i); | 160 EventHandlerClass handlerClass = static_cast<EventHandlerClass>(i); |
| 161 updateEventHandlerInternal(RemoveAll, handlerClass, &target); | 161 updateEventHandlerInternal(RemoveAll, handlerClass, &target); |
| 162 } | 162 } |
| 163 } | 163 } |
| 164 | 164 |
| 165 void EventHandlerRegistry::notifyHasHandlersChanged(EventHandlerClass handlerCla
ss, bool hasActiveHandlers) | 165 void EventHandlerRegistry::notifyHasHandlersChanged(EventHandlerClass handlerCla
ss, bool hasActiveHandlers) |
| 166 { | 166 { |
| 167 ScrollingCoordinator* scrollingCoordinator = m_frameHost.page().scrollingCoo
rdinator(); | |
| 168 | |
| 169 switch (handlerClass) { | 167 switch (handlerClass) { |
| 170 case ScrollEvent: | |
| 171 if (scrollingCoordinator) | |
| 172 scrollingCoordinator->updateHaveScrollEventHandlers(); | |
| 173 break; | |
| 174 case WheelEvent: | |
| 175 if (scrollingCoordinator) | |
| 176 scrollingCoordinator->updateHaveWheelEventHandlers(); | |
| 177 break; | |
| 178 case TouchEvent: | 168 case TouchEvent: |
| 179 m_frameHost.chrome().client().needTouchEvents(hasActiveHandlers); | 169 m_frameHost.chrome().client().needTouchEvents(hasActiveHandlers); |
| 180 break; | 170 break; |
| 181 #if ENABLE(ASSERT) | 171 #if ENABLE(ASSERT) |
| 182 case EventsForTesting: | 172 case EventsForTesting: |
| 183 break; | 173 break; |
| 184 #endif | 174 #endif |
| 185 default: | 175 default: |
| 186 ASSERT_NOT_REACHED(); | 176 ASSERT_NOT_REACHED(); |
| 187 break; | 177 break; |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 ASSERT(window->frame()); | 227 ASSERT(window->frame()); |
| 238 ASSERT(window->frame()->host()); | 228 ASSERT(window->frame()->host()); |
| 239 ASSERT(window->frame()->host() == &m_frameHost); | 229 ASSERT(window->frame()->host() == &m_frameHost); |
| 240 } | 230 } |
| 241 } | 231 } |
| 242 } | 232 } |
| 243 #endif // ENABLE(ASSERT) | 233 #endif // ENABLE(ASSERT) |
| 244 } | 234 } |
| 245 | 235 |
| 246 } // namespace blink | 236 } // namespace blink |
| OLD | NEW |