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

Unified Diff: third_party/WebKit/Source/core/input/GestureManager.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/core/input/GestureManager.cpp
diff --git a/third_party/WebKit/Source/core/input/GestureManager.cpp b/third_party/WebKit/Source/core/input/GestureManager.cpp
index 4171e89cb9197b23cbf1b6600eb877ce0052d7e0..dddf939ef7058fcee0b5a9e58aa0eb4f09d2b0c0 100644
--- a/third_party/WebKit/Source/core/input/GestureManager.cpp
+++ b/third_party/WebKit/Source/core/input/GestureManager.cpp
@@ -5,6 +5,7 @@
#include "core/input/GestureManager.h"
#include "core/dom/Document.h"
+#include "core/dom/DocumentUserGestureToken.h"
#include "core/editing/SelectionController.h"
#include "core/events/GestureEvent.h"
#include "core/frame/FrameHost.h"
@@ -139,8 +140,6 @@ WebInputEventResult GestureManager::handleGestureTap(
uint64_t preDispatchDomTreeVersion = m_frame->document()->domTreeVersion();
uint64_t preDispatchStyleVersion = m_frame->document()->styleVersion();
- UserGestureIndicator gestureIndicator(UserGestureToken::create());
-
HitTestResult currentHitTest = targetedEvent.hitTestResult();
// We use the adjusted position so the application isn't surprised to see a
@@ -183,6 +182,8 @@ WebInputEventResult GestureManager::handleGestureTap(
Node* tappedNode = currentHitTest.innerNode();
IntPoint tappedPosition = gestureEvent.position();
Node* tappedNonTextNode = tappedNode;
+ UserGestureIndicator gestureIndicator(DocumentUserGestureToken::create(
+ tappedNode ? &tappedNode->document() : nullptr));
if (tappedNonTextNode && tappedNonTextNode->isTextNode())
tappedNonTextNode = FlatTreeTraversal::parent(*tappedNonTextNode);
« no previous file with comments | « third_party/WebKit/Source/core/input/EventHandler.cpp ('k') | third_party/WebKit/Source/core/input/KeyboardEventManager.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698