Chromium Code Reviews

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

Issue 490783003: Reduce hit test on ShowPress by moving event targeting to WebViewImpl (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase after other hit test patches Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2010 Google Inc. All rights reserved. 2 * Copyright (C) 2010 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 13 matching lines...)
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WebViewImpl_h 31 #ifndef WebViewImpl_h
32 #define WebViewImpl_h 32 #define WebViewImpl_h
33 33
34 #include "core/page/EventWithHitTestResults.h"
34 #include "core/page/PagePopupDriver.h" 35 #include "core/page/PagePopupDriver.h"
35 #include "platform/geometry/IntPoint.h" 36 #include "platform/geometry/IntPoint.h"
36 #include "platform/geometry/IntRect.h" 37 #include "platform/geometry/IntRect.h"
37 #include "platform/graphics/GraphicsLayer.h" 38 #include "platform/graphics/GraphicsLayer.h"
38 #include "public/platform/WebGestureCurveTarget.h" 39 #include "public/platform/WebGestureCurveTarget.h"
39 #include "public/platform/WebLayer.h" 40 #include "public/platform/WebLayer.h"
40 #include "public/platform/WebPoint.h" 41 #include "public/platform/WebPoint.h"
41 #include "public/platform/WebRect.h" 42 #include "public/platform/WebRect.h"
42 #include "public/platform/WebSize.h" 43 #include "public/platform/WebSize.h"
43 #include "public/platform/WebString.h" 44 #include "public/platform/WebString.h"
(...skipping 380 matching lines...)
424 ScrollDirection*, 425 ScrollDirection*,
425 ScrollGranularity*); 426 ScrollGranularity*);
426 427
427 // Called by a full frame plugin inside this view to inform it that its 428 // Called by a full frame plugin inside this view to inform it that its
428 // zoom level has been updated. The plugin should only call this function 429 // zoom level has been updated. The plugin should only call this function
429 // if the zoom change was triggered by the browser, it's only needed in case 430 // if the zoom change was triggered by the browser, it's only needed in case
430 // a plugin can update its own zoom, say because of its own UI. 431 // a plugin can update its own zoom, say because of its own UI.
431 void fullFramePluginZoomLevelChanged(double zoomLevel); 432 void fullFramePluginZoomLevelChanged(double zoomLevel);
432 433
433 void computeScaleAndScrollForBlockRect(const WebPoint& hitPoint, const WebRe ct& blockRect, float padding, float defaultScaleWhenAlreadyLegible, float& scale , WebPoint& scroll); 434 void computeScaleAndScrollForBlockRect(const WebPoint& hitPoint, const WebRe ct& blockRect, float padding, float defaultScaleWhenAlreadyLegible, float& scale , WebPoint& scroll);
434 Node* bestTapNode(const PlatformGestureEvent& tapEvent); 435 Node* bestTapNode(const GestureEventWithHitTestResults& targetedTapEvent);
435 void enableTapHighlightAtPoint(const PlatformGestureEvent& tapEvent); 436 void enableTapHighlightAtPoint(const GestureEventWithHitTestResults& targete dTapEvent);
436 void enableTapHighlights(WillBeHeapVector<RawPtrWillBeMember<Node> >&); 437 void enableTapHighlights(WillBeHeapVector<RawPtrWillBeMember<Node> >&);
437 void computeScaleAndScrollForFocusedNode(Node* focusedNode, float& scale, In tPoint& scroll, bool& needAnimation); 438 void computeScaleAndScrollForFocusedNode(Node* focusedNode, float& scale, In tPoint& scroll, bool& needAnimation);
438 439
439 void animateDoubleTapZoom(const IntPoint&); 440 void animateDoubleTapZoom(const IntPoint&);
440 441
441 void enableFakePageScaleAnimationForTesting(bool); 442 void enableFakePageScaleAnimationForTesting(bool);
442 bool fakeDoubleTapAnimationPendingForTesting() const { return m_doubleTapZoo mPending; } 443 bool fakeDoubleTapAnimationPendingForTesting() const { return m_doubleTapZoo mPending; }
443 IntPoint fakePageScaleAnimationTargetPositionForTesting() const { return m_f akePageScaleAnimationTargetPosition; } 444 IntPoint fakePageScaleAnimationTargetPositionForTesting() const { return m_f akePageScaleAnimationTargetPosition; }
444 float fakePageScaleAnimationPageScaleForTesting() const { return m_fakePageS caleAnimationPageScaleFactor; } 445 float fakePageScaleAnimationPageScaleForTesting() const { return m_fakePageS caleAnimationPageScaleFactor; }
445 bool fakePageScaleAnimationUseAnchorForTesting() const { return m_fakePageSc aleAnimationUseAnchor; } 446 bool fakePageScaleAnimationUseAnchorForTesting() const { return m_fakePageSc aleAnimationUseAnchor; }
(...skipping 270 matching lines...)
716 bool m_userGestureObserved; 717 bool m_userGestureObserved;
717 }; 718 };
718 719
719 // We have no ways to check if the specified WebView is an instance of 720 // We have no ways to check if the specified WebView is an instance of
720 // WebViewImpl because WebViewImpl is the only implementation of WebView. 721 // WebViewImpl because WebViewImpl is the only implementation of WebView.
721 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); 722 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true);
722 723
723 } // namespace blink 724 } // namespace blink
724 725
725 #endif 726 #endif
OLDNEW

Powered by Google App Engine