| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef TouchEventManager_h | 5 #ifndef TouchEventManager_h |
| 6 #define TouchEventManager_h | 6 #define TouchEventManager_h |
| 7 | 7 |
| 8 #include "core/CoreExport.h" | 8 #include "core/CoreExport.h" |
| 9 #include "core/events/PointerEventFactory.h" | 9 #include "core/events/PointerEventFactory.h" |
| 10 #include "platform/UserGestureIndicator.h" | 10 #include "platform/UserGestureIndicator.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 visitor->trace(touchNode); | 33 visitor->trace(touchNode); |
| 34 visitor->trace(targetFrame); | 34 visitor->trace(targetFrame); |
| 35 } | 35 } |
| 36 | 36 |
| 37 PlatformTouchPoint point; | 37 PlatformTouchPoint point; |
| 38 Member<Node> touchNode; | 38 Member<Node> touchNode; |
| 39 Member<LocalFrame> targetFrame; | 39 Member<LocalFrame> targetFrame; |
| 40 FloatPoint contentPoint; | 40 FloatPoint contentPoint; |
| 41 FloatSize adjustedRadius; | 41 FloatSize adjustedRadius; |
| 42 bool knownTarget; | 42 bool knownTarget; |
| 43 bool consumed; | |
| 44 String region; | 43 String region; |
| 45 }; | 44 }; |
| 46 | 45 |
| 47 explicit TouchEventManager(LocalFrame*); | 46 explicit TouchEventManager(LocalFrame*); |
| 48 ~TouchEventManager(); | 47 ~TouchEventManager(); |
| 49 DECLARE_TRACE(); | 48 DECLARE_TRACE(); |
| 50 | 49 |
| 51 // Returns true if it succesfully generates touchInfos. | 50 // Does the hit-testing again if the original hit test result was not inside |
| 52 bool generateTouchInfosAfterHittest( | 51 // capturing frame for touch events. Returns true if touch events could be |
| 52 // dispatched and otherwise returns false. |
| 53 bool reHitTestTouchPointsIfNeeded( |
| 53 const PlatformTouchEvent&, | 54 const PlatformTouchEvent&, |
| 54 HeapVector<TouchInfo>&); | 55 HeapVector<TouchInfo>&); |
| 55 | 56 |
| 57 // The TouchInfo array is reference just to prevent the copy. However, it |
| 58 // cannot be const as this function might change some of the properties in |
| 59 // TouchInfo objects. |
| 56 WebInputEventResult handleTouchEvent( | 60 WebInputEventResult handleTouchEvent( |
| 57 const PlatformTouchEvent&, | 61 const PlatformTouchEvent&, |
| 58 const HeapVector<TouchInfo>&); | 62 HeapVector<TouchInfo>&); |
| 59 | 63 |
| 60 // Resets the internal state of this object. | 64 // Resets the internal state of this object. |
| 61 void clear(); | 65 void clear(); |
| 62 | 66 |
| 63 // Returns whether there is any touch on the screen. | 67 // Returns whether there is any touch on the screen. |
| 64 bool isAnyTouchActive() const; | 68 bool isAnyTouchActive() const; |
| 65 | 69 |
| 66 private: | 70 private: |
| 67 | 71 |
| 68 void updateTargetAndRegionMapsForTouchStarts(HeapVector<TouchInfo>&); | 72 void updateTargetAndRegionMapsForTouchStarts(HeapVector<TouchInfo>&); |
| (...skipping 24 matching lines...) Expand all Loading... |
| 93 // True if waiting on first touch move after a touch start. | 97 // True if waiting on first touch move after a touch start. |
| 94 bool m_waitingForFirstTouchMove; | 98 bool m_waitingForFirstTouchMove; |
| 95 | 99 |
| 96 }; | 100 }; |
| 97 | 101 |
| 98 } // namespace blink | 102 } // namespace blink |
| 99 | 103 |
| 100 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::TouchEventManager::TouchInfo); | 104 WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::TouchEventManager::TouchInfo); |
| 101 | 105 |
| 102 #endif // TouchEventManager_h | 106 #endif // TouchEventManager_h |
| OLD | NEW |