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