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

Side by Side Diff: Source/web/WebViewImpl.cpp

Issue 392783003: Unconditionally enable gesture tap highlight in blink. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 649 matching lines...) Expand 10 before | Expand all | Expand 10 after
660 PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), even t); 660 PlatformGestureEventBuilder platformEvent(mainFrameImpl()->frameView(), even t);
661 661
662 // FIXME: Remove redundant hit tests by pushing the call to EventHandler::ta rgetGestureEvent 662 // FIXME: Remove redundant hit tests by pushing the call to EventHandler::ta rgetGestureEvent
663 // up to this point and pass GestureEventWithHitTestResults around. 663 // up to this point and pass GestureEventWithHitTestResults around.
664 664
665 // Handle link highlighting outside the main switch to avoid getting lost in the 665 // Handle link highlighting outside the main switch to avoid getting lost in the
666 // complicated set of cases handled below. 666 // complicated set of cases handled below.
667 switch (event.type) { 667 switch (event.type) {
668 case WebInputEvent::GestureShowPress: 668 case WebInputEvent::GestureShowPress:
669 // Queue a highlight animation, then hand off to regular handler. 669 // Queue a highlight animation, then hand off to regular handler.
670 if (settingsImpl()->gestureTapHighlightEnabled()) 670 enableTapHighlightAtPoint(platformEvent);
671 enableTapHighlightAtPoint(platformEvent);
672 break; 671 break;
673 case WebInputEvent::GestureTapCancel: 672 case WebInputEvent::GestureTapCancel:
674 case WebInputEvent::GestureTap: 673 case WebInputEvent::GestureTap:
675 case WebInputEvent::GestureLongPress: 674 case WebInputEvent::GestureLongPress:
676 for (size_t i = 0; i < m_linkHighlights.size(); ++i) 675 for (size_t i = 0; i < m_linkHighlights.size(); ++i)
677 m_linkHighlights[i]->startHighlightAnimationIfNeeded(); 676 m_linkHighlights[i]->startHighlightAnimationIfNeeded();
678 break; 677 break;
679 default: 678 default:
680 break; 679 break;
681 } 680 }
(...skipping 21 matching lines...) Expand all
703 scaledEvent.y = event.y / pageScaleFactor(); 702 scaledEvent.y = event.y / pageScaleFactor();
704 scaledEvent.data.tap.width = event.data.tap.width / pageScaleFactor( ); 703 scaledEvent.data.tap.width = event.data.tap.width / pageScaleFactor( );
705 scaledEvent.data.tap.height = event.data.tap.height / pageScaleFacto r(); 704 scaledEvent.data.tap.height = event.data.tap.height / pageScaleFacto r();
706 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); 705 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);
707 Vector<IntRect> goodTargets; 706 Vector<IntRect> goodTargets;
708 WillBeHeapVector<RawPtrWillBeMember<Node> > highlightNodes; 707 WillBeHeapVector<RawPtrWillBeMember<Node> > highlightNodes;
709 findGoodTouchTargets(boundingBox, mainFrameImpl()->frame(), goodTarg ets, highlightNodes); 708 findGoodTouchTargets(boundingBox, mainFrameImpl()->frame(), goodTarg ets, highlightNodes);
710 // FIXME: replace touch adjustment code when numberOfGoodTargets == 1? 709 // FIXME: replace touch adjustment code when numberOfGoodTargets == 1?
711 // Single candidate case is currently handled by: https://bugs.webki t.org/show_bug.cgi?id=85101 710 // Single candidate case is currently handled by: https://bugs.webki t.org/show_bug.cgi?id=85101
712 if (goodTargets.size() >= 2 && m_client && m_client->didTapMultipleT argets(scaledEvent, goodTargets)) { 711 if (goodTargets.size() >= 2 && m_client && m_client->didTapMultipleT argets(scaledEvent, goodTargets)) {
713 if (settingsImpl()->gestureTapHighlightEnabled()) 712 enableTapHighlights(highlightNodes);
714 enableTapHighlights(highlightNodes);
715 for (size_t i = 0; i < m_linkHighlights.size(); ++i) 713 for (size_t i = 0; i < m_linkHighlights.size(); ++i)
716 m_linkHighlights[i]->startHighlightAnimationIfNeeded(); 714 m_linkHighlights[i]->startHighlightAnimationIfNeeded();
717 eventSwallowed = true; 715 eventSwallowed = true;
718 eventCancelled = true; 716 eventCancelled = true;
719 break; 717 break;
720 } 718 }
721 } 719 }
722 720
723 eventSwallowed = mainFrameImpl()->frame()->eventHandler().handleGestureE vent(platformEvent); 721 eventSwallowed = mainFrameImpl()->frame()->eventHandler().handleGestureE vent(platformEvent);
724 722
(...skipping 3514 matching lines...) Expand 10 before | Expand all | Expand 10 after
4239 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints(); 4237 const PageScaleConstraints& constraints = m_pageScaleConstraintsSet.pageDefi nedConstraints();
4240 4238
4241 if (!mainFrameImpl() || !mainFrameImpl()->frameView()) 4239 if (!mainFrameImpl() || !mainFrameImpl()->frameView())
4242 return false; 4240 return false;
4243 4241
4244 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width 4242 return mainFrameImpl()->frameView()->layoutSize().width() == m_size.width
4245 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1); 4243 || (constraints.minimumScale == constraints.maximumScale && constraints. minimumScale != -1);
4246 } 4244 }
4247 4245
4248 } // namespace blink 4246 } // namespace blink
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698