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

Unified Diff: third_party/WebKit/Source/core/events/TouchEvent.cpp

Issue 2646163002: Remove PlatformTouchEvent/Point and use WebTouchEvent/Point instead (Closed)
Patch Set: Fix nit Created 3 years, 11 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/events/TouchEvent.cpp
diff --git a/third_party/WebKit/Source/core/events/TouchEvent.cpp b/third_party/WebKit/Source/core/events/TouchEvent.cpp
index d0432eb0a0ee47adc8960b51c5f6131edc35afb3..27306e533cd0d05604d533b98d88f999a53b8ba8 100644
--- a/third_party/WebKit/Source/core/events/TouchEvent.cpp
+++ b/third_party/WebKit/Source/core/events/TouchEvent.cpp
@@ -197,43 +197,35 @@ void logTouchTargetHistogram(EventTarget* eventTarget,
} // namespace
TouchEvent::TouchEvent()
- : m_causesScrollingIfUncanceled(false),
- m_firstTouchMoveOrStart(false),
- m_defaultPreventedBeforeCurrentTarget(false),
+ : m_defaultPreventedBeforeCurrentTarget(false),
m_currentTouchAction(TouchActionAuto) {}
-TouchEvent::TouchEvent(TouchList* touches,
+TouchEvent::TouchEvent(const WebTouchEvent& event,
+ TouchList* touches,
TouchList* targetTouches,
TouchList* changedTouches,
const AtomicString& type,
AbstractView* view,
- PlatformEvent::Modifiers modifiers,
- bool cancelable,
- bool causesScrollingIfUncanceled,
- bool firstTouchMoveOrStart,
- TimeTicks platformTimeStamp,
- TouchAction currentTouchAction,
- WebPointerProperties::PointerType pointerType)
+ TouchAction currentTouchAction)
// Pass a sourceCapabilities including the ability to fire touchevents when
// creating this touchevent, which is always created from input device
// capabilities from EventHandler.
: UIEventWithKeyState(
type,
true,
- cancelable,
+ event.isCancelable(),
view,
0,
- modifiers,
- platformTimeStamp,
+ static_cast<PlatformEvent::Modifiers>(event.modifiers()),
+ TimeTicks::FromSeconds(event.timeStampSeconds()),
InputDeviceCapabilities::firesTouchEventsSourceCapabilities()),
m_touches(touches),
m_targetTouches(targetTouches),
m_changedTouches(changedTouches),
- m_causesScrollingIfUncanceled(causesScrollingIfUncanceled),
- m_firstTouchMoveOrStart(firstTouchMoveOrStart),
m_defaultPreventedBeforeCurrentTarget(false),
- m_currentTouchAction(currentTouchAction),
- m_pointerType(pointerType) {}
+ m_currentTouchAction(currentTouchAction) {
+ m_nativeEvent.reset(new WebTouchEvent(event));
+}
TouchEvent::TouchEvent(const AtomicString& type,
const TouchEventInit& initializer)
@@ -241,11 +233,7 @@ TouchEvent::TouchEvent(const AtomicString& type,
m_touches(TouchList::create(initializer.touches())),
m_targetTouches(TouchList::create(initializer.targetTouches())),
m_changedTouches(TouchList::create(initializer.changedTouches())),
- m_causesScrollingIfUncanceled(false),
- m_firstTouchMoveOrStart(false),
- m_defaultPreventedBeforeCurrentTarget(false),
- m_currentTouchAction(TouchActionAuto),
- m_pointerType(WebPointerProperties::PointerType::Unknown) {}
+ m_currentTouchAction(TouchActionAuto) {}
TouchEvent::~TouchEvent() {}
@@ -315,10 +303,16 @@ void TouchEvent::preventDefault() {
}
}
+bool TouchEvent::isTouchStartOrFirstTouchMove() const {
+ if (!m_nativeEvent)
+ return false;
+ return m_nativeEvent->touchStartOrFirstTouchMove;
+}
+
void TouchEvent::doneDispatchingEventAtCurrentTarget() {
// Do not log for non-cancelable events, events that don't block
// scrolling, have more than one touch point or aren't on the main frame.
- if (!cancelable() || !m_firstTouchMoveOrStart ||
+ if (!cancelable() || !isTouchStartOrFirstTouchMove() ||
!(m_touches && m_touches->length() == 1) ||
!(view() && view()->frame() && view()->frame()->isMainFrame()))
return;
« no previous file with comments | « third_party/WebKit/Source/core/events/TouchEvent.h ('k') | third_party/WebKit/Source/core/events/UIEventWithKeyState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698