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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.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/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index f0d353eee250a98187db38d9379e909d01df8a5f..b2b95483f1ff552e4ac13a8bb3b2121b8b464655 100644
--- a/third_party/WebKit/Source/web/WebViewImpl.cpp
+++ b/third_party/WebKit/Source/web/WebViewImpl.cpp
@@ -2294,8 +2294,8 @@ WebInputEventResult WebViewImpl::handleInputEvent(
break;
case WebInputEvent::MouseDown:
eventType = EventTypeNames::mousedown;
- gestureIndicator = wrapUnique(
- new UserGestureIndicator(DefinitelyProcessingNewUserGesture));
+ gestureIndicator = wrapUnique(new UserGestureIndicator(
+ UserGestureToken::create(UserGestureToken::NewGesture)));
m_mouseCaptureGestureToken = gestureIndicator->currentToken();
break;
case WebInputEvent::MouseUp:
@@ -2468,7 +2468,8 @@ bool WebViewImpl::setComposition(
if (m_suppressNextKeypressEvent && !inputMethodController.hasComposition())
return text.isEmpty();
- UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
+ UserGestureIndicator gestureIndicator(
+ UserGestureToken::create(UserGestureToken::NewGesture));
// When the range of composition underlines overlap with the range between
// selectionStart and selectionEnd, WebKit somehow won't paint the selection
@@ -2499,7 +2500,8 @@ bool WebViewImpl::finishComposingText(
}
bool WebViewImpl::commitText(const WebString& text, int relativeCaretPosition) {
- UserGestureIndicator gestureIndicator(DefinitelyProcessingNewUserGesture);
+ UserGestureIndicator gestureIndicator(
+ UserGestureToken::create(UserGestureToken::NewGesture));
LocalFrame* focused = focusedLocalFrameAvailableForIme();
if (!focused)
@@ -3877,7 +3879,8 @@ void WebViewImpl::dragTargetDrop(const WebDragData& webDragData,
DragData dragData(m_currentDragData.get(), pointInRootFrame, screenPoint,
static_cast<DragOperation>(m_operationsAllowed));
- UserGestureIndicator gesture(DefinitelyProcessingNewUserGesture);
+ UserGestureIndicator gesture(
+ UserGestureToken::create(UserGestureToken::NewGesture));
m_page->dragController().performDrag(&dragData);
m_dragOperation = WebDragOperationNone;
@@ -4673,8 +4676,8 @@ void WebViewImpl::pointerLockMouseEvent(const WebInputEvent& event) {
switch (event.type) {
case WebInputEvent::MouseDown:
eventType = EventTypeNames::mousedown;
- gestureIndicator = wrapUnique(
- new UserGestureIndicator(DefinitelyProcessingNewUserGesture));
+ gestureIndicator = wrapUnique(new UserGestureIndicator(
+ UserGestureToken::create(UserGestureToken::NewGesture)));
m_pointerLockGestureToken = gestureIndicator->currentToken();
break;
case WebInputEvent::MouseUp:

Powered by Google App Engine
This is Rietveld 408576698