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

Unified Diff: third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp

Issue 2408333004: Move persistent gesture state to Document, add DocumentUserGestureToken (Closed)
Patch Set: Re-add dropped null check 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/WebFrameWidgetImpl.cpp
diff --git a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
index adfc9fb85a3e8be9bdbd4f139f17e07aaf1521d8..a4181c2e6d7fe1d2ccdeb0d65ec22d7542b91417 100644
--- a/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
+++ b/third_party/WebKit/Source/web/WebFrameWidgetImpl.cpp
@@ -30,6 +30,7 @@
#include "web/WebFrameWidgetImpl.h"
+#include "core/dom/DocumentUserGestureToken.h"
#include "core/editing/EditingUtilities.h"
#include "core/editing/Editor.h"
#include "core/editing/FrameSelection.h"
@@ -349,8 +350,9 @@ WebInputEventResult WebFrameWidgetImpl::handleInputEvent(
break;
case WebInputEvent::MouseDown:
eventType = EventTypeNames::mousedown;
- gestureIndicator = wrapUnique(new UserGestureIndicator(
- UserGestureToken::create(UserGestureToken::NewGesture)));
+ gestureIndicator = wrapUnique(
+ new UserGestureIndicator(DocumentUserGestureToken::create(
+ &node->document(), UserGestureToken::NewGesture)));
m_mouseCaptureGestureToken = gestureIndicator->currentToken();
break;
case WebInputEvent::MouseUp:
@@ -523,8 +525,8 @@ bool WebFrameWidgetImpl::setComposition(
if (m_suppressNextKeypressEvent && !inputMethodController.hasComposition())
return text.isEmpty();
- UserGestureIndicator gestureIndicator(
- UserGestureToken::create(UserGestureToken::NewGesture));
+ UserGestureIndicator gestureIndicator(DocumentUserGestureToken::create(
+ focused->document(), UserGestureToken::NewGesture));
// When the range of composition underlines overlap with the range between
// selectionStart and selectionEnd, WebKit somehow won't paint the selection
@@ -541,12 +543,13 @@ bool WebFrameWidgetImpl::setComposition(
// This code needs to be refactored (http://crbug.com/629721).
bool WebFrameWidgetImpl::commitText(const WebString& text,
int relativeCaretPosition) {
- UserGestureIndicator gestureIndicator(
- UserGestureToken::create(UserGestureToken::NewGesture));
LocalFrame* focused = focusedLocalFrameAvailableForIme();
if (!focused)
return false;
+ UserGestureIndicator gestureIndicator(DocumentUserGestureToken::create(
+ focused->document(), UserGestureToken::NewGesture));
+
if (WebPlugin* plugin = focusedPluginIfInputMethodSupported(focused))
return plugin->commitText(text, relativeCaretPosition);
« no previous file with comments | « third_party/WebKit/Source/web/SuspendableScriptExecutor.cpp ('k') | third_party/WebKit/Source/web/WebLocalFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698