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

Unified Diff: Source/WebKit/chromium/src/WebViewImpl.cpp

Issue 12086096: Merge 141019 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1364/
Patch Set: Created 7 years, 11 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/WebKit/chromium/src/WebViewImpl.h ('k') | Source/WebKit/chromium/tests/WebFrameTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebKit/chromium/src/WebViewImpl.cpp
===================================================================
--- Source/WebKit/chromium/src/WebViewImpl.cpp (revision 141474)
+++ Source/WebKit/chromium/src/WebViewImpl.cpp (working copy)
@@ -728,7 +728,9 @@
hideSelectPopup();
ASSERT(!m_selectPopup);
- if (event.data.tap.width > 0) {
+ // 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()) {
IntRect boundingBox(event.x - event.data.tap.width / 2, event.y - event.data.tap.height / 2, event.data.tap.width, event.data.tap.height);
Vector<IntRect> goodTargets;
findGoodTouchTargets(boundingBox, mainFrameImpl()->frame(), pageScaleFactor(), goodTargets);
@@ -4300,4 +4302,11 @@
}
#endif
+bool WebViewImpl::shouldDisableDesktopWorkarounds()
+{
+ ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewportArguments();
+ return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments.userZoom
+ || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != ViewportArguments::ValueAuto);
+}
+
} // namespace WebKit
« no previous file with comments | « Source/WebKit/chromium/src/WebViewImpl.h ('k') | Source/WebKit/chromium/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698