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 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
269 pointer_event_name = EventTypeNames::pointermove; | 269 pointer_event_name = EventTypeNames::pointermove; |
270 | 270 |
271 pointer_event_init.setView(view); | 271 pointer_event_init.setView(view); |
272 | 272 |
273 UpdateMousePointerEventInit(mouse_event, view, &pointer_event_init); | 273 UpdateMousePointerEventInit(mouse_event, view, &pointer_event_init); |
274 | 274 |
275 // Create coalesced events init structure only for pointermove. | 275 // Create coalesced events init structure only for pointermove. |
276 if (pointer_event_name == EventTypeNames::pointermove) { | 276 if (pointer_event_name == EventTypeNames::pointermove) { |
277 HeapVector<Member<PointerEvent>> coalesced_pointer_events; | 277 HeapVector<Member<PointerEvent>> coalesced_pointer_events; |
278 for (const auto& coalesced_mouse_event : coalesced_mouse_events) { | 278 for (const auto& coalesced_mouse_event : coalesced_mouse_events) { |
279 // TODO(crbug.com/694742): We will set the id from low-level OS events | 279 DCHECK_EQ(mouse_event.id, coalesced_mouse_event.id); |
280 // and enable this DCHECK again. | |
281 // DCHECK_EQ(mouseEvent.id, coalescedMouseEvent.id); | |
282 | 280 |
283 DCHECK_EQ(mouse_event.pointer_type, coalesced_mouse_event.pointer_type); | 281 DCHECK_EQ(mouse_event.pointer_type, coalesced_mouse_event.pointer_type); |
284 PointerEventInit coalesced_event_init = pointer_event_init; | 282 PointerEventInit coalesced_event_init = pointer_event_init; |
285 coalesced_event_init.setCancelable(false); | 283 coalesced_event_init.setCancelable(false); |
286 coalesced_event_init.setBubbles(false); | 284 coalesced_event_init.setBubbles(false); |
287 UpdateMousePointerEventInit(coalesced_mouse_event, view, | 285 UpdateMousePointerEventInit(coalesced_mouse_event, view, |
288 &coalesced_event_init); | 286 &coalesced_event_init); |
289 PointerEvent* event = PointerEvent::Create( | 287 PointerEvent* event = PointerEvent::Create( |
290 pointer_event_name, coalesced_event_init, | 288 pointer_event_name, coalesced_event_init, |
291 TimeTicks::FromSeconds(coalesced_mouse_event.TimeStampSeconds())); | 289 TimeTicks::FromSeconds(coalesced_mouse_event.TimeStampSeconds())); |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 const WebPointerProperties& properties) const { | 557 const WebPointerProperties& properties) const { |
560 if (properties.pointer_type == WebPointerProperties::PointerType::kMouse) | 558 if (properties.pointer_type == WebPointerProperties::PointerType::kMouse) |
561 return PointerEventFactory::kMouseId; | 559 return PointerEventFactory::kMouseId; |
562 IncomingId id(properties.pointer_type, properties.id); | 560 IncomingId id(properties.pointer_type, properties.id); |
563 if (pointer_incoming_id_mapping_.Contains(id)) | 561 if (pointer_incoming_id_mapping_.Contains(id)) |
564 return pointer_incoming_id_mapping_.at(id); | 562 return pointer_incoming_id_mapping_.at(id); |
565 return PointerEventFactory::kInvalidId; | 563 return PointerEventFactory::kInvalidId; |
566 } | 564 } |
567 | 565 |
568 } // namespace blink | 566 } // namespace blink |
OLD | NEW |