| 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 255 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 266 pointerEventName = EventTypeNames::pointermove; | 266 pointerEventName = EventTypeNames::pointermove; |
| 267 | 267 |
| 268 pointerEventInit.setView(view); | 268 pointerEventInit.setView(view); |
| 269 | 269 |
| 270 updateMousePointerEventInit(mouseEvent, view, &pointerEventInit); | 270 updateMousePointerEventInit(mouseEvent, view, &pointerEventInit); |
| 271 | 271 |
| 272 // Create coalesced events init structure only for pointermove. | 272 // Create coalesced events init structure only for pointermove. |
| 273 if (pointerEventName == EventTypeNames::pointermove) { | 273 if (pointerEventName == EventTypeNames::pointermove) { |
| 274 HeapVector<Member<PointerEvent>> coalescedPointerEvents; | 274 HeapVector<Member<PointerEvent>> coalescedPointerEvents; |
| 275 for (const auto& coalescedMouseEvent : coalescedMouseEvents) { | 275 for (const auto& coalescedMouseEvent : coalescedMouseEvents) { |
| 276 DCHECK_EQ(mouseEvent.id, coalescedMouseEvent.id); | 276 // TODO(crbug.com/694742): We will set the id from low-level OS events |
| 277 // and enable this DCHECK again. |
| 278 // DCHECK_EQ(mouseEvent.id, coalescedMouseEvent.id); |
| 279 |
| 277 // TODO(crbug.com/684292): We need further investigation of why the | 280 // TODO(crbug.com/684292): We need further investigation of why the |
| 278 // following DCHECK fails. | 281 // following DCHECK fails. |
| 279 // DCHECK_EQ(mouseEvent.pointerType, coalescedMouseEvent.pointerType); | 282 // DCHECK_EQ(mouseEvent.pointerType, coalescedMouseEvent.pointerType); |
| 280 PointerEventInit coalescedEventInit = pointerEventInit; | 283 PointerEventInit coalescedEventInit = pointerEventInit; |
| 281 updateMousePointerEventInit(coalescedMouseEvent, view, | 284 updateMousePointerEventInit(coalescedMouseEvent, view, |
| 282 &coalescedEventInit); | 285 &coalescedEventInit); |
| 283 coalescedPointerEvents.push_back( | 286 coalescedPointerEvents.push_back( |
| 284 PointerEvent::create(pointerEventName, coalescedEventInit)); | 287 PointerEvent::create(pointerEventName, coalescedEventInit)); |
| 285 } | 288 } |
| 286 pointerEventInit.setCoalescedEvents(coalescedPointerEvents); | 289 pointerEventInit.setCoalescedEvents(coalescedPointerEvents); |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 526 const WebPointerProperties& properties) const { | 529 const WebPointerProperties& properties) const { |
| 527 if (properties.pointerType == WebPointerProperties::PointerType::Mouse) | 530 if (properties.pointerType == WebPointerProperties::PointerType::Mouse) |
| 528 return PointerEventFactory::s_mouseId; | 531 return PointerEventFactory::s_mouseId; |
| 529 IncomingId id(properties.pointerType, properties.id); | 532 IncomingId id(properties.pointerType, properties.id); |
| 530 if (m_pointerIncomingIdMapping.contains(id)) | 533 if (m_pointerIncomingIdMapping.contains(id)) |
| 531 return m_pointerIncomingIdMapping.get(id); | 534 return m_pointerIncomingIdMapping.get(id); |
| 532 return PointerEventFactory::s_invalidId; | 535 return PointerEventFactory::s_invalidId; |
| 533 } | 536 } |
| 534 | 537 |
| 535 } // namespace blink | 538 } // namespace blink |
| OLD | NEW |