| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2011, 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
| 6 * met: | 6 * met: |
| 7 * | 7 * |
| 8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
| (...skipping 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 if (detectContentOnTouch(WebPoint(event.x, event.y))) { | 721 if (detectContentOnTouch(WebPoint(event.x, event.y))) { |
| 722 eventSwallowed = true; | 722 eventSwallowed = true; |
| 723 break; | 723 break; |
| 724 } | 724 } |
| 725 | 725 |
| 726 RefPtr<WebCore::PopupContainer> selectPopup; | 726 RefPtr<WebCore::PopupContainer> selectPopup; |
| 727 selectPopup = m_selectPopup; | 727 selectPopup = m_selectPopup; |
| 728 hideSelectPopup(); | 728 hideSelectPopup(); |
| 729 ASSERT(!m_selectPopup); | 729 ASSERT(!m_selectPopup); |
| 730 | 730 |
| 731 if (event.data.tap.width > 0) { | 731 // Don't trigger a disambiguation popup on sites designed for mobile dev
ices. |
| 732 // Instead, assume that the page has been designed with big enough butto
ns and links. |
| 733 if (event.data.tap.width > 0 && !shouldDisableDesktopWorkarounds()) { |
| 732 IntRect boundingBox(event.x - event.data.tap.width / 2, event.y - ev
ent.data.tap.height / 2, event.data.tap.width, event.data.tap.height); | 734 IntRect boundingBox(event.x - event.data.tap.width / 2, event.y - ev
ent.data.tap.height / 2, event.data.tap.width, event.data.tap.height); |
| 733 Vector<IntRect> goodTargets; | 735 Vector<IntRect> goodTargets; |
| 734 findGoodTouchTargets(boundingBox, mainFrameImpl()->frame(), pageScal
eFactor(), goodTargets); | 736 findGoodTouchTargets(boundingBox, mainFrameImpl()->frame(), pageScal
eFactor(), goodTargets); |
| 735 // FIXME: replace touch adjustment code when numberOfGoodTargets ==
1? | 737 // FIXME: replace touch adjustment code when numberOfGoodTargets ==
1? |
| 736 // Single candidate case is currently handled by: https://bugs.webki
t.org/show_bug.cgi?id=85101 | 738 // Single candidate case is currently handled by: https://bugs.webki
t.org/show_bug.cgi?id=85101 |
| 737 if (goodTargets.size() >= 2 && m_client && m_client->didTapMultipleT
argets(event, goodTargets)) { | 739 if (goodTargets.size() >= 2 && m_client && m_client->didTapMultipleT
argets(event, goodTargets)) { |
| 738 eventSwallowed = true; | 740 eventSwallowed = true; |
| 739 break; | 741 break; |
| 740 } | 742 } |
| 741 } | 743 } |
| (...skipping 3551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4293 | 4295 |
| 4294 const WebMouseEvent& mouseEvent = static_cast<const WebMouseEvent&>(event); | 4296 const WebMouseEvent& mouseEvent = static_cast<const WebMouseEvent&>(event); |
| 4295 | 4297 |
| 4296 if (page()) | 4298 if (page()) |
| 4297 page()->pointerLockController()->dispatchLockedMouseEvent( | 4299 page()->pointerLockController()->dispatchLockedMouseEvent( |
| 4298 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), mouseEvent), | 4300 PlatformMouseEventBuilder(mainFrameImpl()->frameView(), mouseEvent), |
| 4299 eventType); | 4301 eventType); |
| 4300 } | 4302 } |
| 4301 #endif | 4303 #endif |
| 4302 | 4304 |
| 4305 bool WebViewImpl::shouldDisableDesktopWorkarounds() |
| 4306 { |
| 4307 ViewportArguments arguments = mainFrameImpl()->frame()->document()->viewport
Arguments(); |
| 4308 return arguments.width == ViewportArguments::ValueDeviceWidth || !arguments.
userZoom |
| 4309 || (arguments.minZoom == arguments.maxZoom && arguments.minZoom != Viewp
ortArguments::ValueAuto); |
| 4310 } |
| 4311 |
| 4303 } // namespace WebKit | 4312 } // namespace WebKit |
| OLD | NEW |