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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 470833002: Add WebKit API for doing a hit-test that mimics GestureTap (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: tapCount Created 6 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
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/WebViewImpl.cpp
diff --git a/Source/web/WebViewImpl.cpp b/Source/web/WebViewImpl.cpp
index 3edee5b2c31858dee888e5985057244d9036c81d..ef41454e561b70c33b3d5664585f2c4dbd467e32 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -4066,6 +4066,27 @@ HitTestResult WebViewImpl::hitTestResultForWindowPos(const IntPoint& pos)
return result;
}
+WebHitTestResult WebViewImpl::hitTestResultForTap(const WebPoint& tapPointWindowPos, const WebSize& tapArea)
+{
+ if (!m_page->mainFrame()->isLocalFrame())
+ return HitTestResult();
+
+ WebGestureEvent tapEvent;
+ tapEvent.x = tapPointWindowPos.x;
+ tapEvent.y = tapPointWindowPos.y;
+ tapEvent.type = WebInputEvent::GestureTap;
+ tapEvent.data.tap.tapCount = 1;
+ tapEvent.data.tap.width = tapArea.width;
+ tapEvent.data.tap.height = tapArea.height;
+
+ PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), tapEvent);
+
+ HitTestResult result = m_page->deprecatedLocalMainFrame()->eventHandler().hitTestResultForGestureEvent(platformEvent, HitTestRequest::ReadOnly | HitTestRequest::Active).hitTestResult();
+
+ result.setToShadowHostIfInUserAgentShadowRoot();
+ return result;
+}
+
void WebViewImpl::setTabsToLinks(bool enable)
{
m_tabsToLinks = enable;
« no previous file with comments | « Source/web/WebViewImpl.h ('k') | Source/web/tests/WebViewTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698