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 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 const WebMouseEvent& mouseEvent, | 227 const WebMouseEvent& mouseEvent, |
228 const Vector<WebMouseEvent>& coalescedMouseEvents, | 228 const Vector<WebMouseEvent>& coalescedMouseEvents, |
229 LocalDOMWindow* view) { | 229 LocalDOMWindow* view) { |
230 DCHECK(mouseEventName == EventTypeNames::mousemove || | 230 DCHECK(mouseEventName == EventTypeNames::mousemove || |
231 mouseEventName == EventTypeNames::mousedown || | 231 mouseEventName == EventTypeNames::mousedown || |
232 mouseEventName == EventTypeNames::mouseup); | 232 mouseEventName == EventTypeNames::mouseup); |
233 | 233 |
234 AtomicString pointerEventName = | 234 AtomicString pointerEventName = |
235 pointerEventNameForMouseEventName(mouseEventName); | 235 pointerEventNameForMouseEventName(mouseEventName); |
236 | 236 |
237 unsigned buttons = MouseEvent::platformModifiersToButtons( | 237 unsigned buttons = MouseEvent::webInputEventModifiersToButtons( |
238 static_cast<PlatformEvent::Modifiers>(mouseEvent.modifiers())); | 238 static_cast<WebInputEvent::Modifiers>(mouseEvent.modifiers())); |
239 PointerEventInit pointerEventInit; | 239 PointerEventInit pointerEventInit; |
240 | 240 |
241 setIdTypeButtons(pointerEventInit, mouseEvent, buttons); | 241 setIdTypeButtons(pointerEventInit, mouseEvent, buttons); |
242 setEventSpecificFields(pointerEventInit, pointerEventName); | 242 setEventSpecificFields(pointerEventInit, pointerEventName); |
243 | 243 |
244 if (pointerEventName == EventTypeNames::pointerdown || | 244 if (pointerEventName == EventTypeNames::pointerdown || |
245 pointerEventName == EventTypeNames::pointerup) { | 245 pointerEventName == EventTypeNames::pointerup) { |
246 WebPointerProperties::Button button = mouseEvent.button; | 246 WebPointerProperties::Button button = mouseEvent.button; |
247 // TODO(mustaq): Fix when the spec starts supporting hovering erasers. | 247 // TODO(mustaq): Fix when the spec starts supporting hovering erasers. |
248 if (mouseEvent.pointerType == WebPointerProperties::PointerType::Eraser && | 248 if (mouseEvent.pointerType == WebPointerProperties::PointerType::Eraser && |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
524 const WebPointerProperties& properties) const { | 524 const WebPointerProperties& properties) const { |
525 if (properties.pointerType == WebPointerProperties::PointerType::Mouse) | 525 if (properties.pointerType == WebPointerProperties::PointerType::Mouse) |
526 return PointerEventFactory::s_mouseId; | 526 return PointerEventFactory::s_mouseId; |
527 IncomingId id(properties.pointerType, properties.id); | 527 IncomingId id(properties.pointerType, properties.id); |
528 if (m_pointerIncomingIdMapping.contains(id)) | 528 if (m_pointerIncomingIdMapping.contains(id)) |
529 return m_pointerIncomingIdMapping.get(id); | 529 return m_pointerIncomingIdMapping.get(id); |
530 return PointerEventFactory::s_invalidId; | 530 return PointerEventFactory::s_invalidId; |
531 } | 531 } |
532 | 532 |
533 } // namespace blink | 533 } // namespace blink |
OLD | NEW |