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

Unified Diff: third_party/WebKit/Source/core/events/PointerEventFactory.cpp

Issue 1800143002: Notify Blink about start of gesture scroll through a queued event. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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/events/PointerEventFactory.cpp
diff --git a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
index 3c7ef36f4a75d2f1884e87c3a45fcf1e28d8c824..42958999d4c4bdc29562f5b442b3f57a406f7463 100644
--- a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
+++ b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp
@@ -166,13 +166,13 @@ PassRefPtrWillBeRawPtr<PointerEvent> PointerEventFactory::create(const AtomicStr
return PointerEvent::create(type, pointerEventInit);
}
-
-PassRefPtrWillBeRawPtr<PointerEvent> PointerEventFactory::createPointerCancel(const PlatformTouchPoint& touchPoint)
+PassRefPtrWillBeRawPtr<PointerEvent> PointerEventFactory::createPointerCancel(const int pointerId, const WebPointerProperties::PointerType pointerType)
{
PointerEventInit pointerEventInit;
- setIdTypeButtons(pointerEventInit, touchPoint.pointerProperties(), 0);
-
+ pointerEventInit.setPointerId(pointerId);
+ pointerEventInit.setPointerType(pointerTypeNameForWebPointPointerType(pointerType));
+ pointerEventInit.setIsPrimary(isPrimary(pointerId));
pointerEventInit.setBubbles(true);
pointerEventInit.setCancelable(false);
@@ -267,10 +267,8 @@ int PointerEventFactory::addIdAndActiveButtons(const IncomingId p,
return mappedId;
}
-bool PointerEventFactory::remove(
- const PassRefPtrWillBeRawPtr<PointerEvent> pointerEvent)
+bool PointerEventFactory::remove(const int mappedId)
{
- int mappedId = pointerEvent->pointerId();
// Do not remove mouse pointer id as it should always be there
if (mappedId == s_mouseId || !m_pointerIdMapping.contains(mappedId))
return false;
@@ -285,6 +283,19 @@ bool PointerEventFactory::remove(
return true;
}
+WillBeHeapVector<int> PointerEventFactory::getPointerIdsOfType(WebPointerProperties::PointerType pointerType)
+{
+ WillBeHeapVector<int> mappedIds;
+
+ for (auto iter = m_pointerIdMapping.begin(); iter != m_pointerIdMapping.end(); ++iter) {
+ int mappedId = iter->key;
+ if (iter->value.incomingId.pointerType() == static_cast<int>(pointerType))
+ mappedIds.append(mappedId);
+ }
+
+ return mappedIds;
+}
+
bool PointerEventFactory::isPrimary(int mappedId) const
{
if (!m_pointerIdMapping.contains(mappedId))

Powered by Google App Engine
This is Rietveld 408576698