Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(434)

Side by Side Diff: third_party/WebKit/Source/core/events/PointerEvent.h

Issue 2216593002: Drop document.createEvent support for things still behind a flag (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@createEvent
Patch Set: fix LayoutTests Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 PointerEvent* create()
19 {
20 return new PointerEvent;
21 }
22
23 static PointerEvent* create(const AtomicString& type, const PointerEventInit & initializer) 18 static PointerEvent* create(const AtomicString& type, const PointerEventInit & initializer)
24 { 19 {
25 return new PointerEvent(type, initializer); 20 return new PointerEvent(type, initializer);
26 } 21 }
27 22
28 int pointerId() const { return m_pointerId; } 23 int pointerId() const { return m_pointerId; }
29 double width() const { return m_width; } 24 double width() const { return m_width; }
30 double height() const { return m_height; } 25 double height() const { return m_height; }
31 float pressure() const { return m_pressure; } 26 float pressure() const { return m_pressure; }
32 long tiltX() const { return m_tiltX; } 27 long tiltX() const { return m_tiltX; }
33 long tiltY() const { return m_tiltY; } 28 long tiltY() const { return m_tiltY; }
34 const String& pointerType() const { return m_pointerType; } 29 const String& pointerType() const { return m_pointerType; }
35 bool isPrimary() const { return m_isPrimary; } 30 bool isPrimary() const { return m_isPrimary; }
36 31
37 short button() const override { return rawButton(); } 32 short button() const override { return rawButton(); }
38 bool isMouseEvent() const override; 33 bool isMouseEvent() const override;
39 bool isPointerEvent() const override; 34 bool isPointerEvent() const override;
40 35
41 EventDispatchMediator* createMediator() override; 36 EventDispatchMediator* createMediator() override;
42 37
43 DECLARE_VIRTUAL_TRACE(); 38 DECLARE_VIRTUAL_TRACE();
44 39
45 private: 40 private:
46 PointerEvent();
47 PointerEvent(const AtomicString&, const PointerEventInit&); 41 PointerEvent(const AtomicString&, const PointerEventInit&);
48 42
49 int m_pointerId; 43 int m_pointerId;
50 double m_width; 44 double m_width;
51 double m_height; 45 double m_height;
52 float m_pressure; 46 float m_pressure;
53 long m_tiltX; 47 long m_tiltX;
54 long m_tiltY; 48 long m_tiltY;
55 String m_pointerType; 49 String m_pointerType;
56 bool m_isPrimary; 50 bool m_isPrimary;
57 }; 51 };
58 52
59 53
60 class PointerEventDispatchMediator final : public EventDispatchMediator { 54 class PointerEventDispatchMediator final : public EventDispatchMediator {
61 public: 55 public:
62 static PointerEventDispatchMediator* create(PointerEvent*); 56 static PointerEventDispatchMediator* create(PointerEvent*);
63 57
64 private: 58 private:
65 explicit PointerEventDispatchMediator(PointerEvent*); 59 explicit PointerEventDispatchMediator(PointerEvent*);
66 PointerEvent& event() const; 60 PointerEvent& event() const;
67 DispatchEventResult dispatchEvent(EventDispatcher&) const override; 61 DispatchEventResult dispatchEvent(EventDispatcher&) const override;
68 }; 62 };
69 63
70 DEFINE_EVENT_TYPE_CASTS(PointerEvent); 64 DEFINE_EVENT_TYPE_CASTS(PointerEvent);
71 65
72 } // namespace blink 66 } // namespace blink
73 67
74 #endif // PointerEvent_h 68 #endif // PointerEvent_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/events/InputEvent.cpp ('k') | third_party/WebKit/Source/core/events/PointerEvent.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698