| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "core/events/PointerEventFactory.h" | 5 #include "core/events/PointerEventFactory.h" |
| 6 | 6 |
| 7 namespace blink { | 7 namespace blink { |
| 8 | 8 |
| 9 namespace { | 9 namespace { |
| 10 | 10 |
| (...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 309 | 309 |
| 310 bool PointerEventFactory::isPrimary(int mappedId) const | 310 bool PointerEventFactory::isPrimary(int mappedId) const |
| 311 { | 311 { |
| 312 if (!m_pointerIdMapping.contains(mappedId)) | 312 if (!m_pointerIdMapping.contains(mappedId)) |
| 313 return false; | 313 return false; |
| 314 | 314 |
| 315 IncomingId p = m_pointerIdMapping.get(mappedId).incomingId; | 315 IncomingId p = m_pointerIdMapping.get(mappedId).incomingId; |
| 316 return m_primaryId[p.pointerType()] == mappedId; | 316 return m_primaryId[p.pointerType()] == mappedId; |
| 317 } | 317 } |
| 318 | 318 |
| 319 WebPointerProperties::PointerType PointerEventFactory::getPointerType( |
| 320 const int pointerId) |
| 321 { |
| 322 if (m_pointerIdMapping.contains(pointerId)) { |
| 323 return static_cast<WebPointerProperties::PointerType>( |
| 324 m_pointerIdMapping.get(pointerId).incomingId.pointerType()); |
| 325 } |
| 326 return WebPointerProperties::PointerType::Unknown; |
| 327 } |
| 328 |
| 319 bool PointerEventFactory::isActive(const int pointerId) | 329 bool PointerEventFactory::isActive(const int pointerId) |
| 320 { | 330 { |
| 321 return m_pointerIdMapping.contains(pointerId); | 331 return m_pointerIdMapping.contains(pointerId); |
| 322 } | 332 } |
| 323 | 333 |
| 324 bool PointerEventFactory::isActiveButtonsState(const int pointerId) | 334 bool PointerEventFactory::isActiveButtonsState(const int pointerId) |
| 325 { | 335 { |
| 326 return m_pointerIdMapping.contains(pointerId) | 336 return m_pointerIdMapping.contains(pointerId) |
| 327 && m_pointerIdMapping.get(pointerId).isActiveButtons; | 337 && m_pointerIdMapping.get(pointerId).isActiveButtons; |
| 328 } | 338 } |
| 329 | 339 |
| 330 } // namespace blink | 340 } // namespace blink |
| OLD | NEW |