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

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

Issue 329393006: Share a user gesture indicator across touch event sequences (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: updates Created 6 years, 6 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') | no next file » | 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 13bcda8493b2689ac1749950615a0d68e92165b0..4d848f6cc9aa58c1c4ba52701187a1b48abab2ee 100644
--- a/Source/core/page/EventHandler.cpp
+++ b/Source/core/page/EventHandler.cpp
@@ -295,6 +295,7 @@ void EventHandler::clear()
m_previousWheelScrolledNode = nullptr;
m_targetForTouchID.clear();
m_touchSequenceDocument.clear();
+ m_touchSequenceUserGestureToken.clear();
m_scrollGestureHandlingNode = nullptr;
m_lastHitTestResultOverWidget = false;
m_previousGestureScrolledNode = nullptr;
@@ -3403,8 +3404,6 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
const Vector<PlatformTouchPoint>& points = event.touchPoints();
- UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
-
unsigned i;
bool freshTouchEvents = true;
bool allTouchReleased = true;
@@ -3422,8 +3421,18 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
// there may be cases where the browser doesn't reliably release all
// touches. http://crbug.com/345372 tracks this.
m_touchSequenceDocument.clear();
+ m_touchSequenceUserGestureToken.clear();
}
+ OwnPtr<UserGestureIndicator> gestureIndicator;
+
+ if (m_touchSequenceUserGestureToken)
+ gestureIndicator = adoptPtr(new UserGestureIndicator(m_touchSequenceUserGestureToken.release()));
+ else
+ gestureIndicator = adoptPtr(new UserGestureIndicator(DefinitelyProcessingUserGesture));
+
+ m_touchSequenceUserGestureToken = gestureIndicator->currentToken();
+
ASSERT(m_frame->view());
if (m_touchSequenceDocument && (!m_touchSequenceDocument->frame() || !m_touchSequenceDocument->frame()->view())) {
// If the active touch document has no frame or view, it's probably being destroyed
@@ -3486,8 +3495,10 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
// document set to receive the events, then we can skip all the rest of
// this work.
if (!m_touchSequenceDocument || !m_touchSequenceDocument->hasTouchEventHandlers() || !m_touchSequenceDocument->frame()) {
- if (allTouchReleased)
+ if (allTouchReleased) {
m_touchSequenceDocument.clear();
+ m_touchSequenceUserGestureToken.clear();
+ }
return false;
}
@@ -3601,8 +3612,10 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
changedTouches[pointState].m_targets.add(touchTarget);
}
}
- if (allTouchReleased)
+ if (allTouchReleased) {
m_touchSequenceDocument.clear();
+ m_touchSequenceUserGestureToken.clear();
+ }
// Now iterate the changedTouches list and m_targets within it, sending
// events to the targets as required.
« no previous file with comments | « Source/core/page/EventHandler.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698