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

Side by Side Diff: third_party/WebKit/Source/web/WebInputEventConversion.h

Issue 2539283002: Remove PlatformGestureEvent in favour of using WebGestureEvent (Closed)
Patch Set: Rebase and fix comments Created 4 years 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 /* 1 /*
2 * Copyright (C) 2009 Google Inc. All rights reserved. 2 * Copyright (C) 2009 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef WebInputEventConversion_h 31 #ifndef WebInputEventConversion_h
32 #define WebInputEventConversion_h 32 #define WebInputEventConversion_h
33 33
34 #include "platform/PlatformGestureEvent.h"
35 #include "platform/PlatformMouseEvent.h" 34 #include "platform/PlatformMouseEvent.h"
36 #include "platform/PlatformTouchEvent.h" 35 #include "platform/PlatformTouchEvent.h"
37 #include "platform/PlatformWheelEvent.h" 36 #include "platform/PlatformWheelEvent.h"
38 #include "public/platform/WebGestureEvent.h" 37 #include "platform/scroll/ScrollTypes.h"
39 #include "public/platform/WebInputEvent.h" 38 #include "public/platform/WebInputEvent.h"
40 #include "web/WebExport.h" 39 #include "web/WebExport.h"
41 #include "wtf/Compiler.h" 40 #include "wtf/Compiler.h"
42 #include <vector> 41 #include <vector>
43 42
44 namespace blink { 43 namespace blink {
45 44
46 class GestureEvent;
47 class KeyboardEvent; 45 class KeyboardEvent;
48 class MouseEvent; 46 class MouseEvent;
49 class LayoutItem; 47 class LayoutItem;
50 class TouchEvent; 48 class TouchEvent;
51 class WebMouseEvent; 49 class WebMouseEvent;
52 class WebMouseWheelEvent; 50 class WebMouseWheelEvent;
53 class WebKeyboardEvent; 51 class WebKeyboardEvent;
54 class WebTouchEvent; 52 class WebTouchEvent;
55 class WebGestureEvent;
56 class WheelEvent; 53 class WheelEvent;
majidvp 2016/12/15 17:40:46 nit: please either #include WebGestureEvent or for
dtapuska 2016/12/15 21:29:39 Done.
57 class Widget; 54 class Widget;
58 55
59 // These classes are used to convert from WebInputEvent subclasses to 56 // These classes are used to convert from WebInputEvent subclasses to
60 // corresponding WebCore events. 57 // corresponding WebCore events.
61 58
62 class WEB_EXPORT PlatformMouseEventBuilder 59 class WEB_EXPORT PlatformMouseEventBuilder
63 : NON_EXPORTED_BASE(public PlatformMouseEvent) { 60 : NON_EXPORTED_BASE(public PlatformMouseEvent) {
64 public: 61 public:
65 PlatformMouseEventBuilder(Widget*, const WebMouseEvent&); 62 PlatformMouseEventBuilder(Widget*, const WebMouseEvent&);
66 }; 63 };
67 64
68 class WEB_EXPORT PlatformWheelEventBuilder 65 class WEB_EXPORT PlatformWheelEventBuilder
69 : NON_EXPORTED_BASE(public PlatformWheelEvent) { 66 : NON_EXPORTED_BASE(public PlatformWheelEvent) {
70 public: 67 public:
71 PlatformWheelEventBuilder(Widget*, const WebMouseWheelEvent&); 68 PlatformWheelEventBuilder(Widget*, const WebMouseWheelEvent&);
72 }; 69 };
73 70
74 class WEB_EXPORT PlatformGestureEventBuilder
75 : NON_EXPORTED_BASE(public PlatformGestureEvent) {
76 public:
77 PlatformGestureEventBuilder(Widget*, const WebGestureEvent&);
78 };
79
80 // Converts a WebTouchPoint to a PlatformTouchPoint. 71 // Converts a WebTouchPoint to a PlatformTouchPoint.
81 class WEB_EXPORT PlatformTouchPointBuilder 72 class WEB_EXPORT PlatformTouchPointBuilder
82 : NON_EXPORTED_BASE(public PlatformTouchPoint) { 73 : NON_EXPORTED_BASE(public PlatformTouchPoint) {
83 public: 74 public:
84 PlatformTouchPointBuilder(Widget*, const WebTouchPoint&); 75 PlatformTouchPointBuilder(Widget*, const WebTouchPoint&);
85 }; 76 };
86 77
87 // Converts a WebTouchEvent to a PlatformTouchEvent. 78 // Converts a WebTouchEvent to a PlatformTouchEvent.
88 class WEB_EXPORT PlatformTouchEventBuilder 79 class WEB_EXPORT PlatformTouchEventBuilder
89 : NON_EXPORTED_BASE(public PlatformTouchEvent) { 80 : NON_EXPORTED_BASE(public PlatformTouchEvent) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
122 113
123 // Converts a TouchEvent to a corresponding WebTouchEvent. 114 // Converts a TouchEvent to a corresponding WebTouchEvent.
124 // NOTE: WebTouchEvents have a cap on the number of WebTouchPoints. Any points 115 // NOTE: WebTouchEvents have a cap on the number of WebTouchPoints. Any points
125 // exceeding that cap will be dropped. 116 // exceeding that cap will be dropped.
126 class WEB_EXPORT WebTouchEventBuilder 117 class WEB_EXPORT WebTouchEventBuilder
127 : NON_EXPORTED_BASE(public WebTouchEvent) { 118 : NON_EXPORTED_BASE(public WebTouchEvent) {
128 public: 119 public:
129 WebTouchEventBuilder(const LayoutItem, const TouchEvent&); 120 WebTouchEventBuilder(const LayoutItem, const TouchEvent&);
130 }; 121 };
131 122
132 // Converts GestureEvent to a corresponding WebGestureEvent. 123 WEB_EXPORT WebGestureEvent ScaleWebGestureEvent(Widget*,
majidvp 2016/12/15 17:40:46 This is a scale & translate. I think a better name
dtapuska 2016/12/15 21:29:39 Done.
133 // NOTE: If event mapping fails, the type will be set to Undefined. 124 const WebGestureEvent&);
134 class WEB_EXPORT WebGestureEventBuilder
135 : NON_EXPORTED_BASE(public WebGestureEvent) {
136 public:
137 WebGestureEventBuilder(const LayoutItem, const GestureEvent&);
138 };
139 125
140 Vector<PlatformMouseEvent> WEB_EXPORT 126 Vector<PlatformMouseEvent> WEB_EXPORT
141 createPlatformMouseEventVector(Widget*, 127 createPlatformMouseEventVector(Widget*,
142 const std::vector<const WebInputEvent*>&); 128 const std::vector<const WebInputEvent*>&);
143 Vector<PlatformTouchEvent> WEB_EXPORT 129 Vector<PlatformTouchEvent> WEB_EXPORT
144 createPlatformTouchEventVector(Widget*, 130 createPlatformTouchEventVector(Widget*,
145 const std::vector<const WebInputEvent*>&); 131 const std::vector<const WebInputEvent*>&);
146 132
147 } // namespace blink 133 } // namespace blink
148 134
149 #endif 135 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698