OLD | NEW |
---|---|
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/PointerEvent.h" | 5 #include "core/events/PointerEvent.h" |
6 | 6 |
7 #include "core/dom/Element.h" | 7 #include "core/dom/Element.h" |
8 #include "core/events/EventDispatcher.h" | 8 #include "core/events/EventDispatcher.h" |
9 | 9 |
10 namespace blink { | 10 namespace blink { |
(...skipping 17 matching lines...) Expand all Loading... | |
28 if (initializer.hasPressure()) | 28 if (initializer.hasPressure()) |
29 m_pressure = initializer.pressure(); | 29 m_pressure = initializer.pressure(); |
30 if (initializer.hasTiltX()) | 30 if (initializer.hasTiltX()) |
31 m_tiltX = initializer.tiltX(); | 31 m_tiltX = initializer.tiltX(); |
32 if (initializer.hasTiltY()) | 32 if (initializer.hasTiltY()) |
33 m_tiltY = initializer.tiltY(); | 33 m_tiltY = initializer.tiltY(); |
34 if (initializer.hasPointerType()) | 34 if (initializer.hasPointerType()) |
35 m_pointerType = initializer.pointerType(); | 35 m_pointerType = initializer.pointerType(); |
36 if (initializer.hasIsPrimary()) | 36 if (initializer.hasIsPrimary()) |
37 m_isPrimary = initializer.isPrimary(); | 37 m_isPrimary = initializer.isPrimary(); |
38 if (initializer.hasCoalescedEvents()) { | |
39 for (auto coalescedEvent : initializer.coalescedEvents()) { | |
dtapuska
2016/11/23 16:57:24
don't think you need the braces for the for loop
Navid Zolghadr
2016/11/23 17:04:09
Removed.
| |
40 m_coalescedEvents.append(coalescedEvent); | |
41 } | |
42 } | |
38 } | 43 } |
39 | 44 |
40 bool PointerEvent::isMouseEvent() const { | 45 bool PointerEvent::isMouseEvent() const { |
41 return false; | 46 return false; |
42 } | 47 } |
43 | 48 |
44 bool PointerEvent::isPointerEvent() const { | 49 bool PointerEvent::isPointerEvent() const { |
45 return true; | 50 return true; |
46 } | 51 } |
47 | 52 |
48 EventDispatchMediator* PointerEvent::createMediator() { | 53 EventDispatchMediator* PointerEvent::createMediator() { |
49 return PointerEventDispatchMediator::create(this); | 54 return PointerEventDispatchMediator::create(this); |
50 } | 55 } |
51 | 56 |
57 HeapVector<Member<PointerEvent>> PointerEvent::getCoalescedEvents() const { | |
58 return m_coalescedEvents; | |
59 } | |
60 | |
52 DEFINE_TRACE(PointerEvent) { | 61 DEFINE_TRACE(PointerEvent) { |
62 visitor->trace(m_coalescedEvents); | |
53 MouseEvent::trace(visitor); | 63 MouseEvent::trace(visitor); |
54 } | 64 } |
55 | 65 |
56 PointerEventDispatchMediator* PointerEventDispatchMediator::create( | 66 PointerEventDispatchMediator* PointerEventDispatchMediator::create( |
57 PointerEvent* pointerEvent) { | 67 PointerEvent* pointerEvent) { |
58 return new PointerEventDispatchMediator(pointerEvent); | 68 return new PointerEventDispatchMediator(pointerEvent); |
59 } | 69 } |
60 | 70 |
61 PointerEventDispatchMediator::PointerEventDispatchMediator( | 71 PointerEventDispatchMediator::PointerEventDispatchMediator( |
62 PointerEvent* pointerEvent) | 72 PointerEvent* pointerEvent) |
(...skipping 13 matching lines...) Expand all Loading... | |
76 | 86 |
77 DCHECK(!event().target() || event().target() != event().relatedTarget()); | 87 DCHECK(!event().target() || event().target() != event().relatedTarget()); |
78 | 88 |
79 event().eventPath().adjustForRelatedTarget(dispatcher.node(), | 89 event().eventPath().adjustForRelatedTarget(dispatcher.node(), |
80 event().relatedTarget()); | 90 event().relatedTarget()); |
81 | 91 |
82 return dispatcher.dispatch(); | 92 return dispatcher.dispatch(); |
83 } | 93 } |
84 | 94 |
85 } // namespace blink | 95 } // namespace blink |
OLD | NEW |