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 ed0c594b18dff9059e0d1e8379b5d0830892f814..15743376b248a636941cedb304755c87f78a20b4 100644 |
--- a/third_party/WebKit/Source/core/events/PointerEventFactory.cpp |
+++ b/third_party/WebKit/Source/core/events/PointerEventFactory.cpp |
@@ -344,12 +344,12 @@ void PointerEventFactory::clear() { |
int PointerEventFactory::addIdAndActiveButtons(const IncomingId p, |
bool isActiveButtons) { |
// Do not add extra mouse pointer as it was added in initialization |
- if (p.pointerType() == toInt(WebPointerProperties::PointerType::Mouse)) { |
+ if (p.pointerType() == WebPointerProperties::PointerType::Mouse) { |
m_pointerIdMapping.set(s_mouseId, PointerAttributes(p, isActiveButtons)); |
return s_mouseId; |
} |
- int type = p.pointerType(); |
+ int type = p.pointerTypeInt(); |
mustaq
2016/10/13 16:38:25
Nit: s/type/typeInt
One more below.
Navid Zolghadr
2016/10/13 17:32:32
Done.
|
if (m_pointerIncomingIdMapping.contains(p)) { |
int mappedId = m_pointerIncomingIdMapping.get(p); |
m_pointerIdMapping.set(mappedId, PointerAttributes(p, isActiveButtons)); |
@@ -371,7 +371,7 @@ bool PointerEventFactory::remove(const int mappedId) { |
return false; |
IncomingId p = m_pointerIdMapping.get(mappedId).incomingId; |
- int type = p.pointerType(); |
+ int type = p.pointerTypeInt(); |
m_pointerIdMapping.remove(mappedId); |
m_pointerIncomingIdMapping.remove(p); |
if (m_primaryId[type] == mappedId) |
@@ -387,7 +387,7 @@ Vector<int> PointerEventFactory::getPointerIdsOfType( |
for (auto iter = m_pointerIdMapping.begin(); iter != m_pointerIdMapping.end(); |
++iter) { |
int mappedId = iter->key; |
- if (iter->value.incomingId.pointerType() == static_cast<int>(pointerType)) |
+ if (iter->value.incomingId.pointerType() == pointerType) |
mappedIds.append(mappedId); |
} |
@@ -401,13 +401,20 @@ bool PointerEventFactory::isPrimary(int mappedId) const { |
return false; |
IncomingId p = m_pointerIdMapping.get(mappedId).incomingId; |
- return m_primaryId[p.pointerType()] == mappedId; |
+ return m_primaryId[p.pointerTypeInt()] == mappedId; |
} |
bool PointerEventFactory::isActive(const int pointerId) const { |
return m_pointerIdMapping.contains(pointerId); |
} |
+WebPointerProperties::PointerType PointerEventFactory::getPointerType( |
+ int pointerId) const { |
+ if (!isActive(pointerId)) |
+ return WebPointerProperties::PointerType::Unknown; |
+ return m_pointerIdMapping.get(pointerId).incomingId.pointerType(); |
+} |
+ |
bool PointerEventFactory::isActiveButtonsState(const int pointerId) const { |
return m_pointerIdMapping.contains(pointerId) && |
m_pointerIdMapping.get(pointerId).isActiveButtons; |