| 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 #include "platform/PlatformTouchPoint.h" | 10 #include "platform/PlatformTouchPoint.h" |
| 11 | 11 |
| 12 namespace blink { | 12 namespace blink { |
| 13 | 13 |
| 14 class PointerEvent final : public MouseEvent { | 14 class PointerEvent final : public MouseEvent { |
| 15 DEFINE_WRAPPERTYPEINFO(); | 15 DEFINE_WRAPPERTYPEINFO(); |
| 16 | 16 |
| 17 public: | 17 public: |
| 18 static PassRefPtrWillBeRawPtr<PointerEvent> create() | 18 static PassRefPtrWillBeRawPtr<PointerEvent> create() |
| 19 { | 19 { |
| 20 return adoptRefWillBeNoop(new PointerEvent); | 20 return adoptRefWillBeNoop(new PointerEvent); |
| 21 } | 21 } |
| 22 | 22 |
| 23 static PassRefPtrWillBeRawPtr<PointerEvent> create(const AtomicString& type,
const PointerEventInit& initializer) | 23 static PassRefPtrWillBeRawPtr<PointerEvent> create(const AtomicString& type,
const PointerEventInit& initializer) |
| 24 { | 24 { |
| 25 return adoptRefWillBeNoop(new PointerEvent(type, initializer)); | 25 return adoptRefWillBeNoop(new PointerEvent(type, initializer)); |
| 26 } | 26 } |
| 27 | 27 |
| 28 static PassRefPtrWillBeRawPtr<PointerEvent> create(const AtomicString& type, | |
| 29 const bool isPrimary, const PlatformMouseEvent&, PassRefPtrWillBeRawPtr<
Node> relatedTarget, | |
| 30 PassRefPtrWillBeRawPtr<AbstractView>); | |
| 31 | |
| 32 static PassRefPtrWillBeRawPtr<PointerEvent> create(const AtomicString& type, | |
| 33 const bool isPrimary, const PlatformTouchPoint&, | |
| 34 PlatformEvent::Modifiers, | |
| 35 const double width, const double height, | |
| 36 const double clientX, const double clientY); | |
| 37 | |
| 38 long pointerId() const { return m_pointerId; } | 28 long pointerId() const { return m_pointerId; } |
| 39 double width() const { return m_width; } | 29 double width() const { return m_width; } |
| 40 double height() const { return m_height; } | 30 double height() const { return m_height; } |
| 41 float pressure() const { return m_pressure; } | 31 float pressure() const { return m_pressure; } |
| 42 long tiltX() const { return m_tiltX; } | 32 long tiltX() const { return m_tiltX; } |
| 43 long tiltY() const { return m_tiltY; } | 33 long tiltY() const { return m_tiltY; } |
| 44 const String& pointerType() const { return m_pointerType; } | 34 const String& pointerType() const { return m_pointerType; } |
| 45 bool isPrimary() const { return m_isPrimary; } | 35 bool isPrimary() const { return m_isPrimary; } |
| 46 | 36 |
| 47 bool isMouseEvent() const override; | 37 bool isMouseEvent() const override; |
| (...skipping 26 matching lines...) Expand all Loading... |
| 74 explicit PointerEventDispatchMediator(PassRefPtrWillBeRawPtr<PointerEvent>); | 64 explicit PointerEventDispatchMediator(PassRefPtrWillBeRawPtr<PointerEvent>); |
| 75 PointerEvent& event() const; | 65 PointerEvent& event() const; |
| 76 bool dispatchEvent(EventDispatcher&) const override; | 66 bool dispatchEvent(EventDispatcher&) const override; |
| 77 }; | 67 }; |
| 78 | 68 |
| 79 DEFINE_EVENT_TYPE_CASTS(PointerEvent); | 69 DEFINE_EVENT_TYPE_CASTS(PointerEvent); |
| 80 | 70 |
| 81 } // namespace blink | 71 } // namespace blink |
| 82 | 72 |
| 83 #endif // PointerEvent_h | 73 #endif // PointerEvent_h |
| OLD | NEW |