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

Side by Side Diff: Source/core/input/EventHandler.h

Issue 1144313003: Added PointerEvent firing on touch events. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased. TODO fixes. Created 5 years, 6 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 | « Source/core/frame/EventHandlerRegistry.cpp ('k') | Source/core/input/EventHandler.cpp » ('j') | 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) 2006, 2007, 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2006, 2007, 2009, 2010, 2011 Apple 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 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
11 * documentation and/or other materials provided with the distribution. 11 * documentation and/or other materials provided with the distribution.
12 * 12 *
13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY 13 * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 14 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 15 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR 16 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 17 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 18 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 20 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 21 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */ 24 */
25 25
26 #ifndef EventHandler_h 26 #ifndef EventHandler_h
27 #define EventHandler_h 27 #define EventHandler_h
28 28
29 #include "core/CoreExport.h" 29 #include "core/CoreExport.h"
30 #include "core/events/PointerIdManager.h"
30 #include "core/events/TextEventInputType.h" 31 #include "core/events/TextEventInputType.h"
31 #include "core/layout/HitTestRequest.h" 32 #include "core/layout/HitTestRequest.h"
32 #include "core/page/DragActions.h" 33 #include "core/page/DragActions.h"
33 #include "core/page/EventWithHitTestResults.h" 34 #include "core/page/EventWithHitTestResults.h"
34 #include "core/style/ComputedStyleConstants.h" 35 #include "core/style/ComputedStyleConstants.h"
35 #include "platform/Cursor.h" 36 #include "platform/Cursor.h"
36 #include "platform/PlatformMouseEvent.h" 37 #include "platform/PlatformMouseEvent.h"
38 #include "platform/PlatformTouchPoint.h"
37 #include "platform/Timer.h" 39 #include "platform/Timer.h"
38 #include "platform/UserGestureIndicator.h" 40 #include "platform/UserGestureIndicator.h"
39 #include "platform/geometry/LayoutPoint.h" 41 #include "platform/geometry/LayoutPoint.h"
40 #include "platform/heap/Handle.h" 42 #include "platform/heap/Handle.h"
41 #include "platform/scroll/ScrollTypes.h" 43 #include "platform/scroll/ScrollTypes.h"
42 #include "public/platform/WebFocusType.h" 44 #include "public/platform/WebFocusType.h"
43 #include "wtf/Forward.h" 45 #include "wtf/Forward.h"
44 #include "wtf/HashMap.h" 46 #include "wtf/HashMap.h"
45 #include "wtf/HashTraits.h" 47 #include "wtf/HashTraits.h"
46 #include "wtf/RefPtr.h" 48 #include "wtf/RefPtr.h"
(...skipping 10 matching lines...) Expand all
57 class Event; 59 class Event;
58 class EventTarget; 60 class EventTarget;
59 template <typename EventType> 61 template <typename EventType>
60 class EventWithHitTestResults; 62 class EventWithHitTestResults;
61 class FloatPoint; 63 class FloatPoint;
62 class FloatQuad; 64 class FloatQuad;
63 class HTMLFrameSetElement; 65 class HTMLFrameSetElement;
64 class HitTestRequest; 66 class HitTestRequest;
65 class HitTestResult; 67 class HitTestResult;
66 class KeyboardEvent; 68 class KeyboardEvent;
69 class LayoutObject;
67 class LocalFrame; 70 class LocalFrame;
68 class Node; 71 class Node;
69 class OptionalCursor; 72 class OptionalCursor;
70 class PlatformGestureEvent; 73 class PlatformGestureEvent;
71 class PlatformKeyboardEvent; 74 class PlatformKeyboardEvent;
72 class PlatformTouchEvent; 75 class PlatformTouchEvent;
73 class PlatformWheelEvent; 76 class PlatformWheelEvent;
74 class LayoutObject;
75 class ScrollableArea; 77 class ScrollableArea;
76 class Scrollbar; 78 class Scrollbar;
77 class ScrollState; 79 class ScrollState;
78 class SelectionController; 80 class SelectionController;
79 class TextEvent; 81 class TextEvent;
80 class WheelEvent; 82 class WheelEvent;
81 class Widget; 83 class Widget;
82 84
83 enum class DragInitiator; 85 enum class DragInitiator;
84 86
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
309 bool panScrollInProgress() const; 311 bool panScrollInProgress() const;
310 void setLastKnownMousePosition(const PlatformMouseEvent&); 312 void setLastKnownMousePosition(const PlatformMouseEvent&);
311 313
312 bool shouldTopControlsConsumeScroll(FloatSize) const; 314 bool shouldTopControlsConsumeScroll(FloatSize) const;
313 315
314 // If the given element is a shadow host and its root has delegatesFocus=fal se flag, 316 // If the given element is a shadow host and its root has delegatesFocus=fal se flag,
315 // slide focus to its inner element. Returns true if the resulting focus is different from 317 // slide focus to its inner element. Returns true if the resulting focus is different from
316 // the given element. 318 // the given element.
317 bool slideFocusOnShadowHostIfNecessary(const Element&); 319 bool slideFocusOnShadowHostIfNecessary(const Element&);
318 320
321 using TouchInfo = struct {
322 PlatformTouchPoint point;
323 EventTarget* touchTarget;
324 LocalFrame* targetFrame;
325 FloatPoint adjustedPagePoint;
326 FloatSize adjustedRadius;
327 bool knownTarget;
328 bool consumed;
329 };
330
331 void dispatchPointerEventsForTouchEvent(const PlatformTouchEvent&, Vector<To uchInfo>&);
332 bool dispatchTouchEvents(const PlatformTouchEvent&, Vector<TouchInfo>&, bool , bool);
333
319 // NOTE: If adding a new field to this class please ensure that it is 334 // NOTE: If adding a new field to this class please ensure that it is
320 // cleared in |EventHandler::clear()|. 335 // cleared in |EventHandler::clear()|.
321 336
322 LocalFrame* const m_frame; 337 LocalFrame* const m_frame;
323 338
324 bool m_mousePressed; 339 bool m_mousePressed;
325 bool m_capturesDragging; 340 bool m_capturesDragging;
326 RefPtrWillBeMember<Node> m_mousePressNode; 341 RefPtrWillBeMember<Node> m_mousePressNode;
327 342
328 bool m_mouseDownMayStartDrag; 343 bool m_mouseDownMayStartDrag;
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
381 // The target of each active touch point indexed by the touch ID. 396 // The target of each active touch point indexed by the touch ID.
382 using TouchTargetMap = WillBeHeapHashMap<unsigned, RefPtrWillBeMember<EventT arget>, DefaultHash<unsigned>::Hash, WTF::UnsignedWithZeroKeyHashTraits<unsigned >>; 397 using TouchTargetMap = WillBeHeapHashMap<unsigned, RefPtrWillBeMember<EventT arget>, DefaultHash<unsigned>::Hash, WTF::UnsignedWithZeroKeyHashTraits<unsigned >>;
383 TouchTargetMap m_targetForTouchID; 398 TouchTargetMap m_targetForTouchID;
384 399
385 // If set, the document of the active touch sequence. Unset if no touch sequ ence active. 400 // If set, the document of the active touch sequence. Unset if no touch sequ ence active.
386 RefPtrWillBeMember<Document> m_touchSequenceDocument; 401 RefPtrWillBeMember<Document> m_touchSequenceDocument;
387 RefPtr<UserGestureToken> m_touchSequenceUserGestureToken; 402 RefPtr<UserGestureToken> m_touchSequenceUserGestureToken;
388 403
389 bool m_touchPressed; 404 bool m_touchPressed;
390 405
406 PointerIdManager m_pointerIdManager;
407
391 RefPtrWillBeMember<Node> m_scrollGestureHandlingNode; 408 RefPtrWillBeMember<Node> m_scrollGestureHandlingNode;
392 bool m_lastGestureScrollOverWidget; 409 bool m_lastGestureScrollOverWidget;
393 // The most recent element to scroll natively during this scroll 410 // The most recent element to scroll natively during this scroll
394 // sequence. Null if no native element has scrolled this scroll 411 // sequence. Null if no native element has scrolled this scroll
395 // sequence, or if the most recent element to scroll used scroll 412 // sequence, or if the most recent element to scroll used scroll
396 // customization. 413 // customization.
397 RefPtrWillBeMember<Node> m_previousGestureScrolledNode; 414 RefPtrWillBeMember<Node> m_previousGestureScrolledNode;
398 RefPtrWillBeMember<Scrollbar> m_scrollbarHandlingScrollGesture; 415 RefPtrWillBeMember<Scrollbar> m_scrollbarHandlingScrollGesture;
399 416
400 double m_maxMouseMovedDuration; 417 double m_maxMouseMovedDuration;
(...skipping 10 matching lines...) Expand all
411 // scroll sequence in this frame, or any child frames. Only used 428 // scroll sequence in this frame, or any child frames. Only used
412 // with ScrollCustomization. If some delta has been consumed, a 429 // with ScrollCustomization. If some delta has been consumed, a
413 // scroll which shouldn't propagate can't cause any element to 430 // scroll which shouldn't propagate can't cause any element to
414 // scroll other than the |m_previousGestureScrolledNode|. 431 // scroll other than the |m_previousGestureScrolledNode|.
415 bool m_deltaConsumedForScrollSequence; 432 bool m_deltaConsumedForScrollSequence;
416 }; 433 };
417 434
418 } // namespace blink 435 } // namespace blink
419 436
420 #endif // EventHandler_h 437 #endif // EventHandler_h
OLDNEW
« no previous file with comments | « Source/core/frame/EventHandlerRegistry.cpp ('k') | Source/core/input/EventHandler.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698