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 695 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
706 } | 706 } |
707 | 707 |
708 RefPtr<PopupContainer> selectPopup; | 708 RefPtr<PopupContainer> selectPopup; |
709 selectPopup = m_selectPopup; | 709 selectPopup = m_selectPopup; |
710 hideSelectPopup(); | 710 hideSelectPopup(); |
711 ASSERT(!m_selectPopup); | 711 ASSERT(!m_selectPopup); |
712 | 712 |
713 // Don't trigger a disambiguation popup on sites designed for mobile dev
ices. | 713 // Don't trigger a disambiguation popup on sites designed for mobile dev
ices. |
714 // Instead, assume that the page has been designed with big enough butto
ns and links. | 714 // Instead, assume that the page has been designed with big enough butto
ns and links. |
715 if (event.data.tap.width > 0 && !shouldDisableDesktopWorkarounds()) { | 715 if (event.data.tap.width > 0 && !shouldDisableDesktopWorkarounds()) { |
| 716 // FIXME: didTapMultipleTargets should just take a rect instead of |
| 717 // an event. |
716 WebGestureEvent scaledEvent = event; | 718 WebGestureEvent scaledEvent = event; |
717 scaledEvent.x = event.x / pageScaleFactor(); | 719 scaledEvent.x = event.x / pageScaleFactor(); |
718 scaledEvent.y = event.y / pageScaleFactor(); | 720 scaledEvent.y = event.y / pageScaleFactor(); |
719 scaledEvent.data.tap.width = event.data.tap.width / pageScaleFactor(
); | 721 scaledEvent.data.tap.width = event.data.tap.width / pageScaleFactor(
); |
720 scaledEvent.data.tap.height = event.data.tap.height / pageScaleFacto
r(); | 722 scaledEvent.data.tap.height = event.data.tap.height / pageScaleFacto
r(); |
721 IntRect boundingBox( | 723 IntRect boundingBox(scaledEvent.x - scaledEvent.data.tap.width / 2,
scaledEvent.y - scaledEvent.data.tap.height / 2, scaledEvent.data.tap.width, sca
ledEvent.data.tap.height); |
722 scaledEvent.x - scaledEvent.data.tap.width / 2, | |
723 scaledEvent.y - scaledEvent.data.tap.height / 2, | |
724 scaledEvent.data.tap.width, | |
725 scaledEvent.data.tap.height); | |
726 | |
727 WebSize pinchViewportOffset = pinchVirtualViewportEnabled() ? | |
728 flooredIntSize(page()->frameHost().pinchViewport().location()) :
IntSize(); | |
729 | |
730 // Keep bounding box relative to the main frame. | |
731 boundingBox.move(pinchViewportOffset); | |
732 | |
733 Vector<IntRect> goodTargets; | 724 Vector<IntRect> goodTargets; |
734 WillBeHeapVector<RawPtrWillBeMember<Node> > highlightNodes; | 725 WillBeHeapVector<RawPtrWillBeMember<Node> > highlightNodes; |
735 findGoodTouchTargets(boundingBox, mainFrameImpl()->frame(), goodTarg
ets, highlightNodes); | 726 findGoodTouchTargets(boundingBox, mainFrameImpl()->frame(), goodTarg
ets, highlightNodes); |
736 // FIXME: replace touch adjustment code when numberOfGoodTargets ==
1? | 727 // FIXME: replace touch adjustment code when numberOfGoodTargets ==
1? |
737 // Single candidate case is currently handled by: https://bugs.webki
t.org/show_bug.cgi?id=85101 | 728 // Single candidate case is currently handled by: https://bugs.webki
t.org/show_bug.cgi?id=85101 |
738 if (goodTargets.size() >= 2 && m_client | 729 if (goodTargets.size() >= 2 && m_client && m_client->didTapMultipleT
argets(scaledEvent, goodTargets)) { |
739 && m_client->didTapMultipleTargets(pinchViewportOffset, bounding
Box, goodTargets)) { | |
740 | |
741 enableTapHighlights(highlightNodes); | 730 enableTapHighlights(highlightNodes); |
742 for (size_t i = 0; i < m_linkHighlights.size(); ++i) | 731 for (size_t i = 0; i < m_linkHighlights.size(); ++i) |
743 m_linkHighlights[i]->startHighlightAnimationIfNeeded(); | 732 m_linkHighlights[i]->startHighlightAnimationIfNeeded(); |
744 eventSwallowed = true; | 733 eventSwallowed = true; |
745 eventCancelled = true; | 734 eventCancelled = true; |
746 break; | 735 break; |
747 } | 736 } |
748 } | 737 } |
749 | 738 |
750 eventSwallowed = mainFrameImpl()->frame()->eventHandler().handleGestureE
vent(platformEvent); | 739 eventSwallowed = mainFrameImpl()->frame()->eventHandler().handleGestureE
vent(platformEvent); |
(...skipping 3633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4384 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); | 4373 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi
nedConstraints(); |
4385 | 4374 |
4386 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) | 4375 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) |
4387 return false; | 4376 return false; |
4388 | 4377 |
4389 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width | 4378 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width |
4390 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); | 4379 || (constraints.minimumScale == constraints.maximumScale && constraints.
minimumScale != -1); |
4391 } | 4380 } |
4392 | 4381 |
4393 } // namespace blink | 4382 } // namespace blink |
OLD | NEW |