| 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 #include "core/frame/FrameView.h" | 7 #include "core/frame/FrameView.h" |
| 8 #include "platform/geometry/FloatSize.h" | 8 #include "platform/geometry/FloatSize.h" |
| 9 | 9 |
| 10 namespace blink { | 10 namespace blink { |
| 11 | 11 |
| 12 namespace { | 12 namespace { |
| 13 | 13 |
| 14 inline int toInt(WebPointerProperties::PointerType t) { return static_cast<int>(
t); } | 14 inline int toInt(WebPointerProperties::PointerType t) { return static_cast<int>(
t); } |
| 15 | 15 |
| 16 const char* pointerTypeNameForWebPointPointerType(WebPointerProperties::PointerT
ype type) | 16 const char* pointerTypeNameForWebPointPointerType(WebPointerProperties::PointerT
ype type) |
| 17 { | 17 { |
| 18 switch (type) { | 18 switch (type) { |
| 19 case WebPointerProperties::PointerType::Unknown: | 19 case WebPointerProperties::PointerType::Unknown: |
| 20 return ""; | 20 return ""; |
| 21 case WebPointerProperties::PointerType::Touch: | 21 case WebPointerProperties::PointerType::Touch: |
| 22 return "touch"; | 22 return "touch"; |
| 23 case WebPointerProperties::PointerType::Pen: | 23 case WebPointerProperties::PointerType::Pen: |
| 24 case WebPointerProperties::PointerType::Eraser: |
| 25 // TODO(mustaq): Continue eraser plumbing to web API. |
| 26 // See crbug.com/642455 |
| 24 return "pen"; | 27 return "pen"; |
| 25 case WebPointerProperties::PointerType::Mouse: | 28 case WebPointerProperties::PointerType::Mouse: |
| 26 return "mouse"; | 29 return "mouse"; |
| 27 } | 30 } |
| 28 NOTREACHED(); | 31 NOTREACHED(); |
| 29 return ""; | 32 return ""; |
| 30 } | 33 } |
| 31 | 34 |
| 32 const AtomicString& pointerEventNameForMouseEventName( | 35 const AtomicString& pointerEventNameForMouseEventName( |
| 33 const AtomicString& mouseEventName) | 36 const AtomicString& mouseEventName) |
| (...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 if (properties.pointerType | 397 if (properties.pointerType |
| 395 == WebPointerProperties::PointerType::Mouse) | 398 == WebPointerProperties::PointerType::Mouse) |
| 396 return PointerEventFactory::s_mouseId; | 399 return PointerEventFactory::s_mouseId; |
| 397 IncomingId id(properties.pointerType, properties.id); | 400 IncomingId id(properties.pointerType, properties.id); |
| 398 if (m_pointerIncomingIdMapping.contains(id)) | 401 if (m_pointerIncomingIdMapping.contains(id)) |
| 399 return m_pointerIncomingIdMapping.get(id); | 402 return m_pointerIncomingIdMapping.get(id); |
| 400 return PointerEventFactory::s_invalidId; | 403 return PointerEventFactory::s_invalidId; |
| 401 } | 404 } |
| 402 | 405 |
| 403 } // namespace blink | 406 } // namespace blink |
| OLD | NEW |