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

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: Remove unnecessary headers Created 6 years, 4 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 | 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...) Expand all
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 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 ScrollDirection*, 426 ScrollDirection*,
426 ScrollGranularity*); 427 ScrollGranularity*);
427 428
428 // Called by a full frame plugin inside this view to inform it that its 429 // Called by a full frame plugin inside this view to inform it that its
429 // zoom level has been updated. The plugin should only call this function 430 // zoom level has been updated. The plugin should only call this function
430 // if the zoom change was triggered by the browser, it's only needed in case 431 // if the zoom change was triggered by the browser, it's only needed in case
431 // a plugin can update its own zoom, say because of its own UI. 432 // a plugin can update its own zoom, say because of its own UI.
432 void fullFramePluginZoomLevelChanged(double zoomLevel); 433 void fullFramePluginZoomLevelChanged(double zoomLevel);
433 434
434 void computeScaleAndScrollForBlockRect(const WebPoint& hitPoint, const WebRe ct& blockRect, float padding, float defaultScaleWhenAlreadyLegible, float& scale , WebPoint& scroll); 435 void computeScaleAndScrollForBlockRect(const WebPoint& hitPoint, const WebRe ct& blockRect, float padding, float defaultScaleWhenAlreadyLegible, float& scale , WebPoint& scroll);
435 Node* bestTapNode(const PlatformGestureEvent& tapEvent); 436 Node* bestTapNode(const GestureEventWithHitTestResults& targetedTapEvent);
436 void enableTapHighlightAtPoint(const PlatformGestureEvent& tapEvent); 437 void enableTapHighlightAtPoint(const GestureEventWithHitTestResults& targete dTapEvent);
437 void enableTapHighlights(WillBeHeapVector<RawPtrWillBeMember<Node> >&); 438 void enableTapHighlights(WillBeHeapVector<RawPtrWillBeMember<Node> >&);
438 void computeScaleAndScrollForFocusedNode(Node* focusedNode, float& scale, In tPoint& scroll, bool& needAnimation); 439 void computeScaleAndScrollForFocusedNode(Node* focusedNode, float& scale, In tPoint& scroll, bool& needAnimation);
439 440
440 void animateDoubleTapZoom(const IntPoint&); 441 void animateDoubleTapZoom(const IntPoint&);
441 442
442 void enableFakePageScaleAnimationForTesting(bool); 443 void enableFakePageScaleAnimationForTesting(bool);
443 bool fakeDoubleTapAnimationPendingForTesting() const { return m_doubleTapZoo mPending; } 444 bool fakeDoubleTapAnimationPendingForTesting() const { return m_doubleTapZoo mPending; }
444 IntPoint fakePageScaleAnimationTargetPositionForTesting() const { return m_f akePageScaleAnimationTargetPosition; } 445 IntPoint fakePageScaleAnimationTargetPositionForTesting() const { return m_f akePageScaleAnimationTargetPosition; }
445 float fakePageScaleAnimationPageScaleForTesting() const { return m_fakePageS caleAnimationPageScaleFactor; } 446 float fakePageScaleAnimationPageScaleForTesting() const { return m_fakePageS caleAnimationPageScaleFactor; }
446 bool fakePageScaleAnimationUseAnchorForTesting() const { return m_fakePageSc aleAnimationUseAnchor; } 447 bool fakePageScaleAnimationUseAnchorForTesting() const { return m_fakePageSc aleAnimationUseAnchor; }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 565
565 // PageWidgetEventHandler functions 566 // PageWidgetEventHandler functions
566 virtual void handleMouseLeave(LocalFrame&, const WebMouseEvent&) OVERRIDE; 567 virtual void handleMouseLeave(LocalFrame&, const WebMouseEvent&) OVERRIDE;
567 virtual void handleMouseDown(LocalFrame&, const WebMouseEvent&) OVERRIDE; 568 virtual void handleMouseDown(LocalFrame&, const WebMouseEvent&) OVERRIDE;
568 virtual void handleMouseUp(LocalFrame&, const WebMouseEvent&) OVERRIDE; 569 virtual void handleMouseUp(LocalFrame&, const WebMouseEvent&) OVERRIDE;
569 virtual bool handleMouseWheel(LocalFrame&, const WebMouseWheelEvent&) OVERRI DE; 570 virtual bool handleMouseWheel(LocalFrame&, const WebMouseWheelEvent&) OVERRI DE;
570 virtual bool handleGestureEvent(const WebGestureEvent&) OVERRIDE; 571 virtual bool handleGestureEvent(const WebGestureEvent&) OVERRIDE;
571 virtual bool handleKeyEvent(const WebKeyboardEvent&) OVERRIDE; 572 virtual bool handleKeyEvent(const WebKeyboardEvent&) OVERRIDE;
572 virtual bool handleCharEvent(const WebKeyboardEvent&) OVERRIDE; 573 virtual bool handleCharEvent(const WebKeyboardEvent&) OVERRIDE;
573 574
575 bool handleGestureScrollEvent(const WebGestureEvent&);
576
574 InputMethodContext* inputMethodContext(); 577 InputMethodContext* inputMethodContext();
575 WebPlugin* focusedPluginIfInputMethodSupported(LocalFrame*); 578 WebPlugin* focusedPluginIfInputMethodSupported(LocalFrame*);
576 579
577 WebViewClient* m_client; // Can be 0 (e.g. unittests, shared workers, etc.) 580 WebViewClient* m_client; // Can be 0 (e.g. unittests, shared workers, etc.)
578 WebAutofillClient* m_autofillClient; 581 WebAutofillClient* m_autofillClient;
579 WebSpellCheckClient* m_spellCheckClient; 582 WebSpellCheckClient* m_spellCheckClient;
580 583
581 ChromeClientImpl m_chromeClientImpl; 584 ChromeClientImpl m_chromeClientImpl;
582 ContextMenuClientImpl m_contextMenuClientImpl; 585 ContextMenuClientImpl m_contextMenuClientImpl;
583 DragClientImpl m_dragClientImpl; 586 DragClientImpl m_dragClientImpl;
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
717 bool m_userGestureObserved; 720 bool m_userGestureObserved;
718 }; 721 };
719 722
720 // We have no ways to check if the specified WebView is an instance of 723 // We have no ways to check if the specified WebView is an instance of
721 // WebViewImpl because WebViewImpl is the only implementation of WebView. 724 // WebViewImpl because WebViewImpl is the only implementation of WebView.
722 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true); 725 DEFINE_TYPE_CASTS(WebViewImpl, WebView, webView, true, true);
723 726
724 } // namespace blink 727 } // namespace blink
725 728
726 #endif 729 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698