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

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

Issue 2479663002: Move compositor InputHandler from RenderViewImpl to RenderWidget. (Closed)
Patch Set: Add early out to accommodate null frameWidget in webkit_unit_tests. Created 4 years, 1 month 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 f30bf1cc3d93cc278d730bbbcc82956933a72687..01d7312fe98f46d7d46e370fb27a8a41f01bfbbd 100644
--- a/third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp
+++ b/third_party/WebKit/Source/core/frame/EventHandlerRegistry.cpp
@@ -119,8 +119,15 @@ void EventHandlerRegistry::updateEventHandlerInternal(
bool targetSetChanged = updateEventHandlerTargets(op, handlerClass, target);
bool hasHandlers = m_targets[handlerClass].size();
- if (hadHandlers != hasHandlers)
- notifyHasHandlersChanged(handlerClass, hasHandlers);
+ if (hadHandlers != hasHandlers) {
+ Frame* mainFrame = m_frameHost->page().mainFrame();
+ LocalFrame* frame =
+ mainFrame->isLocalFrame() ? toLocalFrame(mainFrame) : nullptr;
+ if (Node* node = target->toNode())
+ frame = node->document().frame();
dcheng 2016/11/10 07:46:11 My reading of this is we'll need to handle the Loc
wjmaclean 2016/11/10 15:57:15 Done. (DCHECK'd as ASSERT is deprecated.)
wjmaclean 2016/11/11 15:40:51 Hmmm, that didn't work. It seems we must have more
dcheng 2016/11/11 22:32:11 Does the debugger know what type of EventTarget is
+
+ notifyHasHandlersChanged(frame, handlerClass, hasHandlers);
+ }
if (targetSetChanged)
notifyDidAddOrRemoveEventHandlerTarget(handlerClass);
@@ -210,6 +217,7 @@ void EventHandlerRegistry::didRemoveAllEventHandlers(EventTarget& target) {
}
void EventHandlerRegistry::notifyHasHandlersChanged(
+ LocalFrame* frame,
EventHandlerClass handlerClass,
bool hasActiveHandlers) {
switch (handlerClass) {
@@ -219,14 +227,14 @@ void EventHandlerRegistry::notifyHasHandlersChanged(
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)));
@@ -234,7 +242,7 @@ void EventHandlerRegistry::notifyHasHandlersChanged(
case TouchEndOrCancelEventBlocking:
case TouchEndOrCancelEventPassive:
m_frameHost->chromeClient().setEventListenerProperties(
- WebEventListenerClass::TouchEndOrCancel,
+ frame, WebEventListenerClass::TouchEndOrCancel,
webEventListenerProperties(
hasEventHandlers(TouchEndOrCancelEventBlocking),
hasEventHandlers(TouchEndOrCancelEventPassive)));

Powered by Google App Engine
This is Rietveld 408576698