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

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

Issue 2973963003: Release mouse pointer capture when it starts drag (Closed)
Patch Set: Remove is_cancel from parameters Created 3 years, 5 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/PointerEventManager.cpp
diff --git a/third_party/WebKit/Source/core/input/PointerEventManager.cpp b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
index dacc7caf55374804525a1f7d4822434b025e2306..b3c36073b191f27f7708b0429072eab96d5a2c43 100644
--- a/third_party/WebKit/Source/core/input/PointerEventManager.cpp
+++ b/third_party/WebKit/Source/core/input/PointerEventManager.cpp
@@ -490,6 +490,32 @@ WebInputEventResult PointerEventManager::SendTouchPointerEvent(
return result;
}
+WebInputEventResult PointerEventManager::HandlePointerEvent(
+ const WebPointerEvent& web_pointer_event,
+ Node* target) {
+ // TODO(crbug.com/625841): This function only handles pointercancel for now.
+ // But we should extend it to handle any pointerevents.
+ DCHECK(web_pointer_event.GetType() == WebInputEvent::Type::kPointerCancel);
dtapuska 2017/07/13 19:21:36 DCHECK_EQ is preferred
+ PointerEvent* pointer_event =
+ pointer_event_factory_.CreatePointerCancelEvent(web_pointer_event);
+
+ EventTarget* effective_target =
+ GetEffectiveTargetForPointerEvent(target, pointer_event->pointerId());
+ WebInputEventResult result =
+ DispatchPointerEvent(effective_target, pointer_event);
+
+ ReleasePointerCapture(pointer_event->pointerId());
+
+ // TODO(nzolghadr): Instead of |ProcessPendingPointerCapture| maybe we
+ // should have used ProcessCaptureAndPositionOfPointerEvent but that might
+ // be sending boundary events however we probably not want that all the
+ // time.
+ ProcessPendingPointerCapture(pointer_event);
+
+ RemovePointer(pointer_event);
+ return result;
+}
+
WebInputEventResult PointerEventManager::SendMousePointerEvent(
Node* target,
const String& canvas_region_id,
« no previous file with comments | « third_party/WebKit/Source/core/input/PointerEventManager.h ('k') | third_party/WebKit/Source/platform/WebPointerEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698