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

Unified Diff: third_party/WebKit/Source/web/WebViewImpl.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/web/WebViewImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebViewImpl.cpp b/third_party/WebKit/Source/web/WebViewImpl.cpp
index 4c849dce31836481ceabab9d9603c44ddefbadd4..59f134ba0c22c6b3f6d4560816f45bd011715209 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)
@@ -3873,7 +3875,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;
@@ -4669,8 +4672,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:
« no previous file with comments | « third_party/WebKit/Source/web/WebUserGestureToken.cpp ('k') | third_party/WebKit/Source/web/tests/WebFrameTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698