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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 584893004: Use the pinch viewport offset for tap disambiguation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fixed the unit test for Android. Created 6 years, 3 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
« no previous file with comments | « Source/core/frame/PinchViewport.h ('k') | Source/web/tests/WebFrameTest.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 d0e3c2cae7c998aec3438814e8836494037fac60..12980dbb9887db9ce69e7e70a5445a2659a6cbb0 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -751,20 +751,31 @@ bool WebViewImpl::handleGestureEvent(const WebGestureEvent& event)
// Don't trigger a disambiguation popup when screencasting, since it's implemented outside of
// compositor pipeline and is not being screencasted itself. This leads to bad user experience.
if (event.data.tap.width > 0 && !shouldDisableDesktopWorkarounds() && !page()->inspectorController().screencastEnabled()) {
- // FIXME: didTapMultipleTargets should just take a rect instead of
- // an event.
WebGestureEvent scaledEvent = event;
scaledEvent.x = event.x / pageScaleFactor();
scaledEvent.y = event.y / pageScaleFactor();
scaledEvent.data.tap.width = event.data.tap.width / pageScaleFactor();
scaledEvent.data.tap.height = event.data.tap.height / pageScaleFactor();
- IntRect boundingBox(scaledEvent.x - scaledEvent.data.tap.width / 2, scaledEvent.y - scaledEvent.data.tap.height / 2, scaledEvent.data.tap.width, scaledEvent.data.tap.height);
+ IntRect boundingBox(
+ scaledEvent.x - scaledEvent.data.tap.width / 2,
+ scaledEvent.y - scaledEvent.data.tap.height / 2,
+ scaledEvent.data.tap.width,
+ scaledEvent.data.tap.height);
+
+ WebSize pinchViewportOffset = pinchVirtualViewportEnabled() ?
+ flooredIntSize(page()->frameHost().pinchViewport().location()) : IntSize();
+
+ // Keep bounding box relative to the main frame.
+ boundingBox.move(pinchViewportOffset);
+
Vector<IntRect> goodTargets;
WillBeHeapVector<RawPtrWillBeMember<Node> > highlightNodes;
findGoodTouchTargets(boundingBox, mainFrameImpl()->frame(), goodTargets, highlightNodes);
// FIXME: replace touch adjustment code when numberOfGoodTargets == 1?
// Single candidate case is currently handled by: https://bugs.webkit.org/show_bug.cgi?id=85101
- if (goodTargets.size() >= 2 && m_client && m_client->didTapMultipleTargets(scaledEvent, goodTargets)) {
+ if (goodTargets.size() >= 2 && m_client
+ && m_client->didTapMultipleTargets(pinchViewportOffset, boundingBox, goodTargets)) {
+
enableTapHighlights(highlightNodes);
for (size_t i = 0; i < m_linkHighlights.size(); ++i)
m_linkHighlights[i]->startHighlightAnimationIfNeeded();
« no previous file with comments | « Source/core/frame/PinchViewport.h ('k') | Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698