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

Unified Diff: third_party/WebKit/Source/web/WebInputEventConversion.cpp

Issue 2586133003: Remove PlatformWheelEvent and use WebMouseWheelEvent instead (Closed)
Patch Set: Adjust function name Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/web/WebInputEventConversion.cpp
diff --git a/third_party/WebKit/Source/web/WebInputEventConversion.cpp b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
index 96c62eed59c42470d583259d5dd182d0c03eeaf1..526994777b2590717872f027a91183d3c95c0de3 100644
--- a/third_party/WebKit/Source/web/WebInputEventConversion.cpp
+++ b/third_party/WebKit/Source/web/WebInputEventConversion.cpp
@@ -210,38 +210,15 @@ PlatformMouseEventBuilder::PlatformMouseEventBuilder(Widget* widget,
}
}
-// PlatformWheelEventBuilder --------------------------------------------------
-
-PlatformWheelEventBuilder::PlatformWheelEventBuilder(
+WebMouseWheelEvent TransformWebMouseWheelEvent(
Widget* widget,
- const WebMouseWheelEvent& e) {
- m_position = widget->convertFromRootFrame(flooredIntPoint(
- convertHitPointToRootFrame(widget, FloatPoint(e.x, e.y))));
- m_globalPosition = IntPoint(e.globalX, e.globalY);
- m_deltaX = scaleDeltaToWindow(widget, e.deltaX);
- m_deltaY = scaleDeltaToWindow(widget, e.deltaY);
- m_wheelTicksX = e.wheelTicksX;
- m_wheelTicksY = e.wheelTicksY;
- m_granularity =
- e.scrollByPage ? ScrollByPageWheelEvent : ScrollByPixelWheelEvent;
-
- m_type = PlatformEvent::Wheel;
-
- m_timestamp = TimeTicks::FromSeconds(e.timeStampSeconds);
- m_modifiers = e.modifiers;
- m_dispatchType = toPlatformDispatchType(e.dispatchType);
-
- m_hasPreciseScrollingDeltas = e.hasPreciseScrollingDeltas;
- m_resendingPluginId = e.resendingPluginId;
- m_railsMode = static_cast<PlatformEvent::RailsMode>(e.railsMode);
-#if OS(MACOSX)
- m_phase = static_cast<PlatformWheelEventPhase>(e.phase);
- m_momentumPhase = static_cast<PlatformWheelEventPhase>(e.momentumPhase);
-#endif
+ const WebMouseWheelEvent& event) {
+ WebMouseWheelEvent result = event;
+ result.setFrameScale(frameScale(widget));
+ result.setFrameTranslate(frameTranslation(widget));
+ return result;
}
-// PlatformGestureEventBuilder -----------------------------------------------
-
WebGestureEvent TransformWebGestureEvent(Widget* widget,
const WebGestureEvent& event) {
WebGestureEvent result = event;
@@ -484,31 +461,6 @@ WebMouseEventBuilder::WebMouseEventBuilder(const Widget* widget,
pointerType = WebPointerProperties::PointerType::Touch;
}
-WebMouseWheelEventBuilder::WebMouseWheelEventBuilder(
- const Widget* widget,
- const LayoutItem layoutItem,
- const WheelEvent& event) {
- if (event.type() != EventTypeNames::wheel &&
- event.type() != EventTypeNames::mousewheel)
- return;
- type = WebInputEvent::MouseWheel;
- updateWebMouseEventFromCoreMouseEvent(event, widget, layoutItem, *this);
- deltaX = -event.deltaX();
- deltaY = -event.deltaY();
- wheelTicksX = event.ticksX();
- wheelTicksY = event.ticksY();
- scrollByPage = event.deltaMode() == WheelEvent::kDomDeltaPage;
- resendingPluginId = event.resendingPluginId();
- railsMode = static_cast<RailsMode>(event.getRailsMode());
- hasPreciseScrollingDeltas = event.hasPreciseScrollingDeltas();
- dispatchType = event.cancelable() ? WebInputEvent::Blocking
- : WebInputEvent::EventNonBlocking;
-#if OS(MACOSX)
- phase = static_cast<Phase>(event.phase());
- momentumPhase = static_cast<Phase>(event.momentumPhase());
-#endif
-}
-
WebKeyboardEventBuilder::WebKeyboardEventBuilder(const KeyboardEvent& event) {
if (const WebKeyboardEvent* webEvent = event.keyEvent()) {
*static_cast<WebKeyboardEvent*>(this) = *webEvent;
« no previous file with comments | « third_party/WebKit/Source/web/WebInputEventConversion.h ('k') | third_party/WebKit/Source/web/WebPluginContainerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698