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

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

Issue 2401123002: UserGestureIndicator is a mess. Clean it up. (Closed)
Patch Set: Callback cleanup, comments 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 eb61190d36c08c681a35afb3027e5adfb179579b..9a25c2fe9e6fd714872059c463c62dbec30b83fd 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();
@@ -899,14 +899,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())
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLVideoElementTest.cpp ('k') | third_party/WebKit/Source/core/input/GestureManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698