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

Unified Diff: third_party/WebKit/Source/core/input/TouchEventManager.h

Issue 2914673002: Refactor TouchEventManager::TouchInfo class (Closed)
Patch Set: Rebase Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/input/TouchEventManager.h
diff --git a/third_party/WebKit/Source/core/input/TouchEventManager.h b/third_party/WebKit/Source/core/input/TouchEventManager.h
index 9b3ab7c67c42b7a214bc345839d9094e4d9f8d8b..d1a953024fa22033c7cc8618bb244ffbc3632342 100644
--- a/third_party/WebKit/Source/core/input/TouchEventManager.h
+++ b/third_party/WebKit/Source/core/input/TouchEventManager.h
@@ -7,6 +7,7 @@
#include "core/CoreExport.h"
#include "core/events/PointerEventFactory.h"
+#include "core/input/EventHandlingUtil.h"
#include "platform/graphics/TouchAction.h"
#include "platform/wtf/Allocator.h"
#include "platform/wtf/HashMap.h"
@@ -27,39 +28,16 @@ class CORE_EXPORT TouchEventManager
WTF_MAKE_NONCOPYABLE(TouchEventManager);
public:
- class TouchInfo {
- DISALLOW_NEW_EXCEPT_PLACEMENT_NEW();
-
- public:
- DEFINE_INLINE_TRACE() {
- visitor->Trace(touch_node);
- visitor->Trace(target_frame);
- }
-
- WebTouchPoint point;
- Member<Node> touch_node;
- Member<LocalFrame> target_frame;
- FloatPoint content_point;
- FloatSize adjusted_radius;
- bool known_target;
- String region;
- };
explicit TouchEventManager(LocalFrame&);
DECLARE_TRACE();
- // Does the hit-testing again if the original hit test result was not inside
- // capturing frame for touch events. Returns true if touch events could be
- // dispatched and otherwise returns false.
- bool ReHitTestTouchPointsIfNeeded(const WebTouchEvent&,
- HeapVector<TouchInfo>&);
-
- // The TouchInfo array is reference just to prevent the copy. However, it
- // cannot be const as this function might change some of the properties in
- // TouchInfo objects.
- WebInputEventResult HandleTouchEvent(const WebTouchEvent&,
- const Vector<WebTouchEvent>&,
- HeapVector<TouchInfo>&);
+ // The entries in touch point array of WebTouchEvent (i.e. first parameter)
+ // correspond to the entries of the PointerEventTargets (i.e. last parameter).
+ WebInputEventResult HandleTouchEvent(
+ const WebTouchEvent&,
+ const Vector<WebTouchEvent>&,
+ const HeapVector<EventHandlingUtil::PointerEventTarget>&);
// Resets the internal state of this object.
void Clear();
@@ -68,12 +46,21 @@ class CORE_EXPORT TouchEventManager
bool IsAnyTouchActive() const;
private:
- void UpdateTargetAndRegionMapsForTouchStarts(HeapVector<TouchInfo>&);
- void SetAllPropertiesOfTouchInfos(HeapVector<TouchInfo>&);
+ Touch* CreateDomTouch(const WebTouchPoint&, bool* known_target);
+
+ void UpdateTargetAndRegionMapsForTouchStart(
+ const WebTouchPoint&,
+ const EventHandlingUtil::PointerEventTarget&);
+
+ // Does the hit-testing if the original hit test result was not inside
+ // capturing frame for touch events. Returns true if touch events could be
+ // dispatched and otherwise returns false.
+ bool HitTestTouchPointsIfNeeded(
+ const WebTouchEvent&,
+ const HeapVector<EventHandlingUtil::PointerEventTarget>&);
WebInputEventResult DispatchTouchEvents(const WebTouchEvent&,
const Vector<WebTouchEvent>&,
- const HeapVector<TouchInfo>&,
bool all_touches_released);
// NOTE: If adding a new field to this class please ensure that it is
@@ -108,6 +95,4 @@ class CORE_EXPORT TouchEventManager
} // namespace blink
-WTF_ALLOW_INIT_WITH_MEM_FUNCTIONS(blink::TouchEventManager::TouchInfo);
-
#endif // TouchEventManager_h

Powered by Google App Engine
This is Rietveld 408576698