Changeset 55572 in webkit
- Timestamp:
- Mar 4, 2010 10:09:23 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r55570 r55572 1 2010-03-04 Garret Kelly <gdk@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Changing private members from PlatformTouchEvent and PlatformTouchPoint 6 to be protected, so that Chromium's PlatformTouchEventBuilder and 7 PlatformTouchPointBuilder can access them. Exercised by the 8 fast/events/touch tests. 9 https://bugs.webkit.org/show_bug.cgi?id=35760 10 11 * platform/PlatformTouchEvent.h: 12 (WebCore::PlatformTouchEvent::~PlatformTouchEvent): 13 * platform/PlatformTouchPoint.h: 14 (WebCore::PlatformTouchPoint::~PlatformTouchPoint): 15 1 16 2010-03-04 Fumitoshi Ukai <ukai@chromium.org> 2 17 -
trunk/WebCore/platform/PlatformTouchEvent.h
r53994 r55572 68 68 bool metaKey() const { return m_metaKey; } 69 69 70 pr ivate:70 protected: 71 71 TouchEventType m_type; 72 72 Vector<PlatformTouchPoint> m_touchPoints; -
trunk/WebCore/platform/PlatformTouchPoint.h
r55230 r55572 56 56 IntPoint pos() const { return m_pos; } 57 57 58 pr ivate:58 protected: 59 59 unsigned m_id; 60 60 State m_state; -
trunk/WebKit/chromium/ChangeLog
r55571 r55572 1 2010-03-04 Garret Kelly <gdk@chromium.org> 2 3 Reviewed by Darin Fisher. 4 5 Adding PlatformTouchEventBuilder and PlatformTouchPointBuilder for 6 converting Chromium WebTouchEvent and WebTouchPoint types to 7 corresponding WebCore types. 8 https://bugs.webkit.org/show_bug.cgi?id=35760 9 10 * src/WebInputEventConversion.cpp: 11 (WebKit::toPlatformTouchEventType): 12 (WebKit::toPlatformTouchPointState): 13 (WebKit::PlatformTouchPointBuilder::PlatformTouchPointBuilder): 14 (WebKit::PlatformTouchEventBuilder::PlatformTouchEventBuilder): 15 * src/WebInputEventConversion.h: 16 1 17 2010-03-04 John Gregg <johnnyg@google.com> 2 18 -
trunk/WebKit/chromium/src/WebInputEventConversion.cpp
r51904 r55572 169 169 } 170 170 171 #if ENABLE(TOUCH_EVENTS) 172 static inline TouchEventType toPlatformTouchEventType(const WebInputEvent::Type type) 173 { 174 switch (type) { 175 case WebInputEvent::TouchStart: 176 return TouchStart; 177 case WebInputEvent::TouchMove: 178 return TouchMove; 179 case WebInputEvent::TouchEnd: 180 return TouchEnd; 181 case WebInputEvent::TouchCancel: 182 return TouchCancel; 183 default: 184 ASSERT_NOT_REACHED(); 185 } 186 } 187 188 static inline PlatformTouchPoint::State toPlatformTouchPointState(const WebTouchPoint::State state) 189 { 190 switch (state) { 191 case WebTouchPoint::StateReleased: 192 return PlatformTouchPoint::TouchReleased; 193 case WebTouchPoint::StatePressed: 194 return PlatformTouchPoint::TouchPressed; 195 case WebTouchPoint::StateMoved: 196 return PlatformTouchPoint::TouchMoved; 197 case WebTouchPoint::StateStationary: 198 return PlatformTouchPoint::TouchStationary; 199 case WebTouchPoint::StateCancelled: 200 return PlatformTouchPoint::TouchCancelled; 201 case WebTouchPoint::StateUndefined: 202 ASSERT_NOT_REACHED(); 203 } 204 } 205 206 PlatformTouchPointBuilder::PlatformTouchPointBuilder(Widget* widget, const WebTouchPoint& point) 207 { 208 m_id = point.id; 209 m_state = toPlatformTouchPointState(point.state); 210 m_pos = widget->convertFromContainingWindow(point.position); 211 m_screenPos = point.screenPosition; 212 } 213 214 PlatformTouchEventBuilder::PlatformTouchEventBuilder(Widget* widget, const WebTouchEvent& event) 215 { 216 m_type = toPlatformTouchEventType(event.type); 217 m_ctrlKey = event.modifiers & WebInputEvent::ControlKey; 218 m_altKey = event.modifiers & WebInputEvent::AltKey; 219 m_shiftKey = event.modifiers & WebInputEvent::ShiftKey; 220 m_metaKey = event.modifiers & WebInputEvent::MetaKey; 221 222 m_touchPoints.resize(event.touchPointsLength); 223 for (int i = 0; i < event.touchPointsLength; ++i) 224 m_touchPoints.append(PlatformTouchPointBuilder(widget, event.touchPoints[i])); 225 } 226 #endif 227 171 228 static int getWebInputModifiers(const UIEventWithKeyState& event) 172 229 { -
trunk/WebKit/chromium/src/WebInputEventConversion.h
r50721 r55572 38 38 #include "PlatformKeyboardEvent.h" 39 39 #include "PlatformMouseEvent.h" 40 #include "PlatformTouchEvent.h" 40 41 #include "PlatformWheelEvent.h" 41 42 … … 73 74 }; 74 75 76 #if ENABLE(TOUCH_EVENTS) 77 class PlatformTouchPointBuilder : public WebCore::PlatformTouchPoint { 78 public: 79 PlatformTouchPointBuilder(WebCore::Widget*, const WebTouchPoint&); 80 }; 81 82 class PlatformTouchEventBuilder : public WebCore::PlatformTouchEvent { 83 public: 84 PlatformTouchEventBuilder(WebCore::Widget*, const WebTouchEvent&); 85 }; 86 #endif 87 75 88 // Converts a WebCore::MouseEvent to a corresponding WebMouseEvent. view is 76 89 // the ScrollView corresponding to the event. Returns true if successful.
Note: See TracChangeset
for help on using the changeset viewer.