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

Unified Diff: Source/core/page/EventHandler.cpp

Issue 14280004: Revert removal of events (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/page/EventHandler.h ('k') | Source/core/page/Frame.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/page/EventHandler.cpp
diff --git a/Source/core/page/EventHandler.cpp b/Source/core/page/EventHandler.cpp
index 9d619468aea9bf2756546befb51b6c63f51b37cc..951c0ef819297d684f838dd490d11ba17936d1e8 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -70,7 +70,6 @@
#include "PlatformEvent.h"
#include "PlatformGestureEvent.h"
#include "PlatformKeyboardEvent.h"
-#include "PlatformTouchEvent.h"
#include "PlatformWheelEvent.h"
#include "PluginDocument.h"
#include "RenderFrameSet.h"
@@ -106,6 +105,12 @@
#include "SVGUseElement.h"
#endif
+#if ENABLE(TOUCH_EVENTS)
+#include "PlatformTouchEvent.h"
+#include "TouchEvent.h"
+#include "TouchList.h"
+#endif
+
#if ENABLE(CSS_IMAGE_SET)
#include "StyleCachedImageSet.h"
#endif
@@ -183,6 +188,7 @@ private:
double m_start;
};
+#if ENABLE(TOUCH_EVENTS)
class SyntheticTouchPoint : public PlatformTouchPoint {
public:
@@ -247,6 +253,7 @@ public:
m_touchPoints.append(SyntheticTouchPoint(event));
}
};
+#endif
static inline ScrollGranularity wheelGranularityToScrollGranularity(unsigned deltaMode)
{
@@ -304,8 +311,10 @@ EventHandler::EventHandler(Frame* frame)
, m_mousePositionIsUnknown(true)
, m_mouseDownTimestamp(0)
, m_widgetIsLatched(false)
+#if ENABLE(TOUCH_EVENTS)
, m_originatingTouchPointTargetKey(0)
, m_touchPressed(false)
+#endif
, m_scrollGestureHandlingNode(0)
, m_lastHitTestResultOverWidget(false)
, m_maxMouseMovedDuration(0)
@@ -363,9 +372,11 @@ void EventHandler::clear()
m_capturingMouseEventsNode = 0;
m_latchedWheelEventNode = 0;
m_previousWheelScrolledNode = 0;
+#if ENABLE(TOUCH_EVENTS)
m_originatingTouchPointTargets.clear();
m_originatingTouchPointDocument.clear();
m_originatingTouchPointTargetKey = 0;
+#endif
m_scrollGestureHandlingNode = 0;
m_lastHitTestResultOverWidget = false;
m_previousGestureScrolledNode = 0;
@@ -1359,9 +1370,11 @@ bool EventHandler::handleMousePressEvent(const PlatformMouseEvent& mouseEvent)
return true;
}
+#if ENABLE(TOUCH_EVENTS)
bool defaultPrevented = dispatchSyntheticTouchEventIfEnabled(mouseEvent);
if (defaultPrevented)
return true;
+#endif
UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
m_lastMouseDownUserGestureToken = gestureIndicator.currentToken();
@@ -1551,9 +1564,11 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi
if (!m_frame)
return false;
+#if ENABLE(TOUCH_EVENTS)
bool defaultPrevented = dispatchSyntheticTouchEventIfEnabled(mouseEvent);
if (defaultPrevented)
return true;
+#endif
RefPtr<FrameView> protector(m_frame->view());
@@ -1589,9 +1604,11 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi
hitType |= HitTestRequest::ReadOnly;
}
+#if ENABLE(TOUCH_EVENTS)
// Treat any mouse move events as readonly if the user is currently touching the screen.
if (m_touchPressed)
hitType |= HitTestRequest::Active | HitTestRequest::ReadOnly;
+#endif
HitTestRequest request(hitType);
MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseEvent);
if (hoveredNode)
@@ -1688,9 +1705,11 @@ bool EventHandler::handleMouseReleaseEvent(const PlatformMouseEvent& mouseEvent)
m_frame->selection()->setCaretBlinkingSuspended(false);
+#if ENABLE(TOUCH_EVENTS)
bool defaultPrevented = dispatchSyntheticTouchEventIfEnabled(mouseEvent);
if (defaultPrevented)
return true;
+#endif
OwnPtr<UserGestureIndicator> gestureIndicator;
@@ -3621,6 +3640,8 @@ void EventHandler::updateLastScrollbarUnderMouse(Scrollbar* scrollbar, bool setL
}
}
+#if ENABLE(TOUCH_EVENTS)
+
static const AtomicString& eventNameForTouchPointState(PlatformTouchPoint::State state)
{
switch (state) {
@@ -3887,6 +3908,8 @@ bool EventHandler::dispatchSyntheticTouchEventIfEnabled(const PlatformMouseEvent
return handleTouchEvent(touchEvent);
}
+#endif
+
void EventHandler::setLastKnownMousePosition(const PlatformMouseEvent& event)
{
m_mousePositionIsUnknown = false;
« no previous file with comments | « Source/core/page/EventHandler.h ('k') | Source/core/page/Frame.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698