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

Unified Diff: Source/web/WebViewImpl.cpp

Issue 602583003: Revert of Use the pinch viewport offset for tap disambiguation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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 fb1319408e8750fa7a8b241af09a204a79d513ed..32ea4c39b4ab1fa813e1725558d86faaaeec4bb4 100644
--- a/Source/web/WebViewImpl.cpp
+++ b/Source/web/WebViewImpl.cpp
@@ -713,31 +713,20 @@
// Don't trigger a disambiguation popup on sites designed for mobile devices.
// Instead, assume that the page has been designed with big enough buttons and links.
if (event.data.tap.width > 0 && !shouldDisableDesktopWorkarounds()) {
+ // 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);
-
- WebSize pinchViewportOffset = pinchVirtualViewportEnabled() ?
- flooredIntSize(page()->frameHost().pinchViewport().location()) : IntSize();
-
- // Keep bounding box relative to the main frame.
- boundingBox.move(pinchViewportOffset);
-
+ IntRect boundingBox(scaledEvent.x - scaledEvent.data.tap.width / 2, scaledEvent.y - scaledEvent.data.tap.height / 2, scaledEvent.data.tap.width, scaledEvent.data.tap.height);
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(pinchViewportOffset, boundingBox, goodTargets)) {
-
+ if (goodTargets.size() >= 2 && m_client && m_client->didTapMultipleTargets(scaledEvent, 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