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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.cpp

Issue 2951053005: Add Mojo API for Blink hit testing (Closed)
Patch Set: 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/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 6cde5a4680945779ea86da6e77b4405b1cd34343..3ec3ccc32505785f99540b27d2406cfc1f92ce2c 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -2139,6 +2139,22 @@ bool WebViewImpl::HasVerticalScrollbar() {
const WebInputEvent* WebViewImpl::current_input_event_ = nullptr;
+WebFrame* WebViewImpl::HitTestFrameAt(const WebFloatPoint& point) {
+ if (!MainFrameImpl())
+ return nullptr;
+
+ HitTestResult hit_test_result =
+ MainFrameImpl()->GetFrame()->GetEventHandler().HitTestResultAtPoint(
+ LayoutPoint((FloatPoint)point));
+ Frame* target_frame = nullptr;
+ Node* target_node = hit_test_result.InnerNode();
+ if (target_node->IsFrameOwnerElement())
+ target_frame = ToHTMLFrameOwnerElement(target_node)->ContentFrame();
+ else
+ target_frame = target_node->GetDocument().GetFrame();
+ return WebFrame::FromFrame(target_frame);
+}
+
WebInputEventResult WebViewImpl::HandleInputEvent(
const WebCoalescedInputEvent& coalesced_event) {
const WebInputEvent& input_event = coalesced_event.Event();

Powered by Google App Engine
This is Rietveld 408576698