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 #ifndef PointerEvent_h | 5 #ifndef PointerEvent_h |
6 #define PointerEvent_h | 6 #define PointerEvent_h |
7 | 7 |
8 #include "core/events/MouseEvent.h" | 8 #include "core/events/MouseEvent.h" |
9 #include "core/events/PointerEventInit.h" | 9 #include "core/events/PointerEventInit.h" |
10 | 10 |
11 namespace blink { | 11 namespace blink { |
12 | 12 |
13 class CORE_EXPORT PointerEvent final : public MouseEvent { | 13 class CORE_EXPORT PointerEvent final : public MouseEvent { |
14 DEFINE_WRAPPERTYPEINFO(); | 14 DEFINE_WRAPPERTYPEINFO(); |
15 | 15 |
16 public: | 16 public: |
17 static PointerEvent* Create(const AtomicString& type, | 17 static PointerEvent* Create(const AtomicString& type, |
| 18 const PointerEventInit& initializer, |
| 19 TimeTicks platform_time_stamp) { |
| 20 return new PointerEvent(type, initializer, platform_time_stamp); |
| 21 } |
| 22 static PointerEvent* Create(const AtomicString& type, |
18 const PointerEventInit& initializer) { | 23 const PointerEventInit& initializer) { |
19 return new PointerEvent(type, initializer); | 24 return PointerEvent::Create(type, initializer, TimeTicks::Now()); |
20 } | 25 } |
21 | 26 |
22 int pointerId() const { return pointer_id_; } | 27 int pointerId() const { return pointer_id_; } |
23 double width() const { return width_; } | 28 double width() const { return width_; } |
24 double height() const { return height_; } | 29 double height() const { return height_; } |
25 float pressure() const { return pressure_; } | 30 float pressure() const { return pressure_; } |
26 long tiltX() const { return tilt_x_; } | 31 long tiltX() const { return tilt_x_; } |
27 long tiltY() const { return tilt_y_; } | 32 long tiltY() const { return tilt_y_; } |
28 float tangentialPressure() const { return tangential_pressure_; } | 33 float tangentialPressure() const { return tangential_pressure_; } |
29 long twist() const { return twist_; } | 34 long twist() const { return twist_; } |
30 const String& pointerType() const { return pointer_type_; } | 35 const String& pointerType() const { return pointer_type_; } |
31 bool isPrimary() const { return is_primary_; } | 36 bool isPrimary() const { return is_primary_; } |
32 | 37 |
33 short button() const override { return RawButton(); } | 38 short button() const override { return RawButton(); } |
34 bool IsMouseEvent() const override; | 39 bool IsMouseEvent() const override; |
35 bool IsPointerEvent() const override; | 40 bool IsPointerEvent() const override; |
36 | 41 |
37 EventDispatchMediator* CreateMediator() override; | 42 EventDispatchMediator* CreateMediator() override; |
38 | 43 |
39 HeapVector<Member<PointerEvent>> getCoalescedEvents() const; | 44 HeapVector<Member<PointerEvent>> getCoalescedEvents() const; |
40 | 45 |
41 DECLARE_VIRTUAL_TRACE(); | 46 DECLARE_VIRTUAL_TRACE(); |
42 | 47 |
43 private: | 48 private: |
44 PointerEvent(const AtomicString&, const PointerEventInit&); | 49 PointerEvent(const AtomicString&, |
| 50 const PointerEventInit&, |
| 51 TimeTicks platform_time_stamp); |
45 | 52 |
46 int pointer_id_; | 53 int pointer_id_; |
47 double width_; | 54 double width_; |
48 double height_; | 55 double height_; |
49 float pressure_; | 56 float pressure_; |
50 long tilt_x_; | 57 long tilt_x_; |
51 long tilt_y_; | 58 long tilt_y_; |
52 float tangential_pressure_; | 59 float tangential_pressure_; |
53 long twist_; | 60 long twist_; |
54 String pointer_type_; | 61 String pointer_type_; |
(...skipping 10 matching lines...) Expand all Loading... |
65 explicit PointerEventDispatchMediator(PointerEvent*); | 72 explicit PointerEventDispatchMediator(PointerEvent*); |
66 PointerEvent& Event() const; | 73 PointerEvent& Event() const; |
67 DispatchEventResult DispatchEvent(EventDispatcher&) const override; | 74 DispatchEventResult DispatchEvent(EventDispatcher&) const override; |
68 }; | 75 }; |
69 | 76 |
70 DEFINE_EVENT_TYPE_CASTS(PointerEvent); | 77 DEFINE_EVENT_TYPE_CASTS(PointerEvent); |
71 | 78 |
72 } // namespace blink | 79 } // namespace blink |
73 | 80 |
74 #endif // PointerEvent_h | 81 #endif // PointerEvent_h |
OLD | NEW |