Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Unified Diff: third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp

Issue 2479663002: Move compositor InputHandler from RenderViewImpl to RenderWidget. (Closed)
Patch Set: Rebase to master@{#445291}. Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp
diff --git a/third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp b/third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp
index ce6dc461e0efd79036f6d654cfe7c9635aa48c41..f8cc545bd5c628645289a8bffa163fbba5cbbea7 100644
--- a/third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp
+++ b/third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp
@@ -119,8 +119,18 @@ void EventHandlerRegistry::updateEventHandlerInternal(
bool targetSetChanged = updateEventHandlerTargets(op, handlerClass, target);
bool hasHandlers = m_targets[handlerClass].size();
- if (hadHandlers != hasHandlers)
- notifyHasHandlersChanged(handlerClass, hasHandlers);
+ if (hadHandlers != hasHandlers) {
+ LocalFrame* frame = nullptr;
+ if (Node* node = target->toNode()) {
+ frame = node->document().frame();
+ } else if (LocalDOMWindow* domWindow = target->toLocalDOMWindow()) {
+ frame = domWindow->frame();
+ } else {
+ NOTREACHED() << "Unexpected target type for event handler.";
+ }
+
+ notifyHasHandlersChanged(frame, handlerClass, hasHandlers);
+ }
if (targetSetChanged)
notifyDidAddOrRemoveEventHandlerTarget(handlerClass);
@@ -195,23 +205,25 @@ void EventHandlerRegistry::didRemoveAllEventHandlers(EventTarget& target) {
}
void EventHandlerRegistry::notifyHasHandlersChanged(
+ LocalFrame* frame,
EventHandlerClass handlerClass,
bool hasActiveHandlers) {
switch (handlerClass) {
case ScrollEvent:
- m_frameHost->chromeClient().setHasScrollEventHandlers(hasActiveHandlers);
+ m_frameHost->chromeClient().setHasScrollEventHandlers(frame,
+ hasActiveHandlers);
break;
case WheelEventBlocking:
case WheelEventPassive:
m_frameHost->chromeClient().setEventListenerProperties(
- WebEventListenerClass::MouseWheel,
+ frame, WebEventListenerClass::MouseWheel,
webEventListenerProperties(hasEventHandlers(WheelEventBlocking),
hasEventHandlers(WheelEventPassive)));
break;
case TouchStartOrMoveEventBlocking:
case TouchStartOrMoveEventPassive:
m_frameHost->chromeClient().setEventListenerProperties(
- WebEventListenerClass::TouchStartOrMove,
+ frame, WebEventListenerClass::TouchStartOrMove,
webEventListenerProperties(
hasEventHandlers(TouchStartOrMoveEventBlocking),
hasEventHandlers(TouchStartOrMoveEventPassive)));
@@ -219,7 +231,7 @@ void EventHandlerRegistry::notifyHasHandlersChanged(
case TouchEndOrCancelEventBlocking:
case TouchEndOrCancelEventPassive:
m_frameHost->chromeClient().setEventListenerProperties(
- WebEventListenerClass::TouchEndOrCancel,
+ frame, WebEventListenerClass::TouchEndOrCancel,
webEventListenerProperties(
hasEventHandlers(TouchEndOrCancelEventBlocking),
hasEventHandlers(TouchEndOrCancelEventPassive)));
« no previous file with comments | « third_party/WebKit/Source/core/frame/EventHandlerRegistry.h ('k') | third_party/WebKit/Source/core/frame/FrameView.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698