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

Unified Diff: third_party/WebKit/Source/core/input/EventHandlingUtil.cpp

Issue 2936023002: MouseWheelEventManager is added to handle wheel events. (Closed)
Patch Set: review comments addressed. Created 3 years, 6 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/input/EventHandlingUtil.cpp
diff --git a/third_party/WebKit/Source/core/input/EventHandlingUtil.cpp b/third_party/WebKit/Source/core/input/EventHandlingUtil.cpp
index 2ae4665c82a002a4953cdc4729abd10cddf36626..5b183876a38531405e3c417e255badd0596cdb7d 100644
--- a/third_party/WebKit/Source/core/input/EventHandlingUtil.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandlingUtil.cpp
@@ -6,6 +6,7 @@
#include "core/frame/LocalFrame.h"
#include "core/frame/LocalFrameView.h"
+#include "core/layout/LayoutEmbeddedContent.h"
#include "core/layout/api/LayoutViewItem.h"
#include "core/paint/PaintLayer.h"
#include "platform/scroll/ScrollableArea.h"
@@ -128,5 +129,28 @@ MouseEventWithHitTestResults PerformMouseEventHitTest(
mev);
}
+LocalFrame* SubframeForTargetNode(Node* node) {
+ if (!node)
+ return nullptr;
+
+ LayoutObject* layout_object = node->GetLayoutObject();
+ if (!layout_object || !layout_object->IsLayoutEmbeddedContent())
+ return nullptr;
+
+ LocalFrameView* frame_view =
+ ToLayoutEmbeddedContent(layout_object)->ChildFrameView();
+ if (!frame_view)
+ return nullptr;
+
+ return &frame_view->GetFrame();
+}
+
+LocalFrame* SubframeForHitTestResult(
+ const MouseEventWithHitTestResults& hit_test_result) {
+ if (!hit_test_result.IsOverEmbeddedContentView())
+ return nullptr;
+ return SubframeForTargetNode(hit_test_result.InnerNode());
+}
+
} // namespace EventHandlingUtil
} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698