| 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 { |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 const WebMouseEvent& mouseEvent, | 218 const WebMouseEvent& mouseEvent, |
| 219 const Vector<WebMouseEvent>& coalescedMouseEvents, | 219 const Vector<WebMouseEvent>& coalescedMouseEvents, |
| 220 LocalDOMWindow* view) { | 220 LocalDOMWindow* view) { |
| 221 DCHECK(mouseEventName == EventTypeNames::mousemove || | 221 DCHECK(mouseEventName == EventTypeNames::mousemove || |
| 222 mouseEventName == EventTypeNames::mousedown || | 222 mouseEventName == EventTypeNames::mousedown || |
| 223 mouseEventName == EventTypeNames::mouseup); | 223 mouseEventName == EventTypeNames::mouseup); |
| 224 | 224 |
| 225 AtomicString pointerEventName = | 225 AtomicString pointerEventName = |
| 226 pointerEventNameForMouseEventName(mouseEventName); | 226 pointerEventNameForMouseEventName(mouseEventName); |
| 227 | 227 |
| 228 unsigned buttons = MouseEvent::platformModifiersToButtons( | 228 unsigned buttons = MouseEvent::webInputEventModifiersToButtons( |
| 229 static_cast<PlatformEvent::Modifiers>(mouseEvent.modifiers())); | 229 static_cast<WebInputEvent::Modifiers>(mouseEvent.modifiers())); |
| 230 PointerEventInit pointerEventInit; | 230 PointerEventInit pointerEventInit; |
| 231 | 231 |
| 232 setIdTypeButtons(pointerEventInit, mouseEvent, buttons); | 232 setIdTypeButtons(pointerEventInit, mouseEvent, buttons); |
| 233 setEventSpecificFields(pointerEventInit, pointerEventName); | 233 setEventSpecificFields(pointerEventInit, pointerEventName); |
| 234 | 234 |
| 235 if (pointerEventName == EventTypeNames::pointerdown || | 235 if (pointerEventName == EventTypeNames::pointerdown || |
| 236 pointerEventName == EventTypeNames::pointerup) { | 236 pointerEventName == EventTypeNames::pointerup) { |
| 237 WebPointerProperties::Button button = mouseEvent.button; | 237 WebPointerProperties::Button button = mouseEvent.button; |
| 238 // TODO(mustaq): Fix when the spec starts supporting hovering erasers. | 238 // TODO(mustaq): Fix when the spec starts supporting hovering erasers. |
| 239 if (mouseEvent.pointerType == WebPointerProperties::PointerType::Eraser && | 239 if (mouseEvent.pointerType == WebPointerProperties::PointerType::Eraser && |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 const WebPointerProperties& properties) const { | 517 const WebPointerProperties& properties) const { |
| 518 if (properties.pointerType == WebPointerProperties::PointerType::Mouse) | 518 if (properties.pointerType == WebPointerProperties::PointerType::Mouse) |
| 519 return PointerEventFactory::s_mouseId; | 519 return PointerEventFactory::s_mouseId; |
| 520 IncomingId id(properties.pointerType, properties.id); | 520 IncomingId id(properties.pointerType, properties.id); |
| 521 if (m_pointerIncomingIdMapping.contains(id)) | 521 if (m_pointerIncomingIdMapping.contains(id)) |
| 522 return m_pointerIncomingIdMapping.get(id); | 522 return m_pointerIncomingIdMapping.get(id); |
| 523 return PointerEventFactory::s_invalidId; | 523 return PointerEventFactory::s_invalidId; |
| 524 } | 524 } |
| 525 | 525 |
| 526 } // namespace blink | 526 } // namespace blink |
| OLD | NEW |