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

Unified Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 2401123002: UserGestureIndicator is a mess. Clean it up. (Closed)
Patch Set: Fix tests Created 4 years, 2 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/EventHandler.cpp
diff --git a/third_party/WebKit/Source/core/input/EventHandler.cpp b/third_party/WebKit/Source/core/input/EventHandler.cpp
index c31464529b27022ca02f752885b7041c6351c5ed..d28dc4c5eb88365b6da52f3fb556998e286684bf 100644
--- a/third_party/WebKit/Source/core/input/EventHandler.cpp
+++ b/third_party/WebKit/Source/core/input/EventHandler.cpp
@@ -572,7 +572,7 @@ WebInputEventResult EventHandler::handleMousePressEvent(
WebPointerProperties::Button::NoButton)
return WebInputEventResult::HandledSuppressed;
- UserGestureIndicator gestureIndicator(DefinitelyProcessingUserGesture);
+ UserGestureIndicator gestureIndicator(UserGestureToken::create());
m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToken =
UserGestureIndicator::currentToken();
@@ -902,14 +902,17 @@ WebInputEventResult EventHandler::handleMouseReleaseEvent(
std::unique_ptr<UserGestureIndicator> gestureIndicator;
- if (m_frame->localFrameRoot()->eventHandler().m_lastMouseDownUserGestureToken)
+ if (m_frame->localFrameRoot()
+ ->eventHandler()
+ .m_lastMouseDownUserGestureToken) {
gestureIndicator = wrapUnique(new UserGestureIndicator(
m_frame->localFrameRoot()
->eventHandler()
.m_lastMouseDownUserGestureToken.release()));
- else
+ } else {
gestureIndicator =
- wrapUnique(new UserGestureIndicator(DefinitelyProcessingUserGesture));
+ wrapUnique(new UserGestureIndicator(UserGestureToken::create()));
+ }
if (RuntimeEnabledFeatures::middleClickAutoscrollEnabled()) {
if (Page* page = m_frame->page())

Powered by Google App Engine
This is Rietveld 408576698