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

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

Issue 1892653003: Extract touch handling logic from EventHandler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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
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
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 #if OS(WIN) 103 #if OS(WIN)
104 void startPanScrolling(LayoutObject*); 104 void startPanScrolling(LayoutObject*);
105 #endif 105 #endif
106 106
107 void stopAutoscroll(); 107 void stopAutoscroll();
108 108
109 void dispatchFakeMouseMoveEventSoon(); 109 void dispatchFakeMouseMoveEventSoon();
110 void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&); 110 void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&);
111 111
112 static HitTestResult hitTestResultInFrame(LocalFrame*, const LayoutPoint&, H itTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRe quest::Active);
113
112 HitTestResult hitTestResultAtPoint(const LayoutPoint&, 114 HitTestResult hitTestResultAtPoint(const LayoutPoint&,
113 HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active, 115 HitTestRequest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest::Active,
114 const LayoutSize& padding = LayoutSize()); 116 const LayoutSize& padding = LayoutSize());
115 117
116 bool mousePressed() const { return m_mousePressed; } 118 bool mousePressed() const { return m_mousePressed; }
117 119
118 void setCapturingMouseEventsNode(Node*); // A caller is responsible for rese tting capturing node to 0. 120 void setCapturingMouseEventsNode(Node*); // A caller is responsible for rese tting capturing node to 0.
119 121
120 WebInputEventResult updateDragAndDrop(const PlatformMouseEvent&, DataTransfe r*); 122 WebInputEventResult updateDragAndDrop(const PlatformMouseEvent&, DataTransfe r*);
121 void cancelDragAndDrop(const PlatformMouseEvent&, DataTransfer*); 123 void cancelDragAndDrop(const PlatformMouseEvent&, DataTransfer*);
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
304 // granularity - The units that the scroll delta parameter is in. 306 // granularity - The units that the scroll delta parameter is in.
305 // startNode - Optional. If provided, start chaining from the given node. 307 // startNode - Optional. If provided, start chaining from the given node.
306 // If not, use the current focus or last clicked node. 308 // If not, use the current focus or last clicked node.
307 bool logicalScroll(ScrollDirection, ScrollGranularity, Node* startNode = nul lptr); 309 bool logicalScroll(ScrollDirection, ScrollGranularity, Node* startNode = nul lptr);
308 310
309 void resetOverscroll(bool didScrollX, bool didScrollY); 311 void resetOverscroll(bool didScrollX, bool didScrollY);
310 void handleOverscroll(const ScrollResult&, const FloatPoint& position = Floa tPoint(), const FloatSize& velocity = FloatSize()); 312 void handleOverscroll(const ScrollResult&, const FloatPoint& position = Floa tPoint(), const FloatSize& velocity = FloatSize());
311 313
312 void customizedScroll(const Node& startNode, ScrollState&); 314 void customizedScroll(const Node& startNode, ScrollState&);
313 315
314 HitTestResult hitTestResultInFrame(LocalFrame*, const LayoutPoint&, HitTestR equest::HitTestRequestType hitType = HitTestRequest::ReadOnly | HitTestRequest:: Active);
315
316 void invalidateClick(); 316 void invalidateClick();
317 317
318 Node* updateMouseEventTargetNode(Node*, const PlatformMouseEvent&); 318 Node* updateMouseEventTargetNode(Node*, const PlatformMouseEvent&);
319 void updateMouseEventTargetNodeAndSendEvents(Node*, const PlatformMouseEvent &, bool isFrameBoundaryTransition = false); 319 void updateMouseEventTargetNodeAndSendEvents(Node*, const PlatformMouseEvent &, bool isFrameBoundaryTransition = false);
320 320
321 321
322 MouseEventWithHitTestResults prepareMouseEvent(const HitTestRequest&, const PlatformMouseEvent&); 322 MouseEventWithHitTestResults prepareMouseEvent(const HitTestRequest&, const PlatformMouseEvent&);
323 323
324 WebInputEventResult dispatchMouseEvent(const AtomicString& eventType, Node* target, int clickCount, const PlatformMouseEvent&); 324 WebInputEventResult dispatchMouseEvent(const AtomicString& eventType, Node* target, int clickCount, const PlatformMouseEvent&);
325 325
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 bool panScrollInProgress() const; 371 bool panScrollInProgress() const;
372 void setLastKnownMousePosition(const PlatformMouseEvent&); 372 void setLastKnownMousePosition(const PlatformMouseEvent&);
373 373
374 bool shouldTopControlsConsumeScroll(FloatSize) const; 374 bool shouldTopControlsConsumeScroll(FloatSize) const;
375 375
376 // If the given element is a shadow host and its root has delegatesFocus=fal se flag, 376 // If the given element is a shadow host and its root has delegatesFocus=fal se flag,
377 // slide focus to its inner element. Returns true if the resulting focus is different from 377 // slide focus to its inner element. Returns true if the resulting focus is different from
378 // the given element. 378 // the given element.
379 bool slideFocusOnShadowHostIfNecessary(const Element&); 379 bool slideFocusOnShadowHostIfNecessary(const Element&);
380 380
381 void dispatchPointerEvents(const PlatformTouchEvent&, HeapVector<TouchInfo>& );
382
383 WebInputEventResult dispatchTouchEvents(const PlatformTouchEvent&, HeapVecto r<TouchInfo>&, bool, bool);
384
385 // NOTE: If adding a new field to this class please ensure that it is 381 // NOTE: If adding a new field to this class please ensure that it is
386 // cleared in |EventHandler::clear()|. 382 // cleared in |EventHandler::clear()|.
387 383
388 const Member<LocalFrame> m_frame; 384 const Member<LocalFrame> m_frame;
389 385
390 // Current button-press state for mouse/mouse-like-stylus. 386 // Current button-press state for mouse/mouse-like-stylus.
391 // TODO(crbug.com/563676): Buggy for chorded buttons. 387 // TODO(crbug.com/563676): Buggy for chorded buttons.
392 bool m_mousePressed; 388 bool m_mousePressed;
393 389
394 bool m_capturesDragging; 390 bool m_capturesDragging;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
436 432
437 bool m_mousePositionIsUnknown; 433 bool m_mousePositionIsUnknown;
438 // The last mouse movement position this frame has seen in root frame coordi nates. 434 // The last mouse movement position this frame has seen in root frame coordi nates.
439 IntPoint m_lastKnownMousePosition; 435 IntPoint m_lastKnownMousePosition;
440 IntPoint m_lastKnownMouseGlobalPosition; 436 IntPoint m_lastKnownMouseGlobalPosition;
441 IntPoint m_mouseDownPos; // In our view's coords. 437 IntPoint m_mouseDownPos; // In our view's coords.
442 double m_mouseDownTimestamp; 438 double m_mouseDownTimestamp;
443 PlatformMouseEvent m_mouseDown; 439 PlatformMouseEvent m_mouseDown;
444 RefPtr<UserGestureToken> m_lastMouseDownUserGestureToken; 440 RefPtr<UserGestureToken> m_lastMouseDownUserGestureToken;
445 441
446 // The target of each active touch point indexed by the touch ID.
447 using TouchTargetMap = HeapHashMap<unsigned, Member<EventTarget>, DefaultHas h<unsigned>::Hash, WTF::UnsignedWithZeroKeyHashTraits<unsigned>>;
448 TouchTargetMap m_targetForTouchID;
449 using TouchRegionMap = HeapHashMap<unsigned, String, DefaultHash<unsigned>:: Hash, WTF::UnsignedWithZeroKeyHashTraits<unsigned>>;
450 TouchRegionMap m_regionForTouchID;
451
452 // If set, the document of the active touch sequence. Unset if no touch sequ ence active.
453 Member<Document> m_touchSequenceDocument;
454 RefPtr<UserGestureToken> m_touchSequenceUserGestureToken;
455
456 bool m_touchPressed;
457
458 PointerEventManager m_pointerEventManager; 442 PointerEventManager m_pointerEventManager;
459 443
460 Member<Node> m_scrollGestureHandlingNode; 444 Member<Node> m_scrollGestureHandlingNode;
461 bool m_lastGestureScrollOverWidget; 445 bool m_lastGestureScrollOverWidget;
462 // The most recent element to scroll natively during this scroll 446 // The most recent element to scroll natively during this scroll
463 // sequence. Null if no native element has scrolled this scroll 447 // sequence. Null if no native element has scrolled this scroll
464 // sequence, or if the most recent element to scroll used scroll 448 // sequence, or if the most recent element to scroll used scroll
465 // customization. 449 // customization.
466 Member<Node> m_previousGestureScrolledNode; 450 Member<Node> m_previousGestureScrolledNode;
467 Member<Scrollbar> m_scrollbarHandlingScrollGesture; 451 Member<Scrollbar> m_scrollbarHandlingScrollGesture;
(...skipping 14 matching lines...) Expand all
482 // scroll which shouldn't propagate can't cause any element to 466 // scroll which shouldn't propagate can't cause any element to
483 // scroll other than the |m_previousGestureScrolledNode|. 467 // scroll other than the |m_previousGestureScrolledNode|.
484 bool m_deltaConsumedForScrollSequence; 468 bool m_deltaConsumedForScrollSequence;
485 }; 469 };
486 470
487 } // namespace blink 471 } // namespace blink
488 472
489 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::EventHandler::TouchInfo); 473 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::EventHandler::TouchInfo);
490 474
491 #endif // EventHandler_h 475 #endif // EventHandler_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698