Index: Source/core/events/WheelEvent.cpp |
diff --git a/Source/core/events/WheelEvent.cpp b/Source/core/events/WheelEvent.cpp |
index e3ed2cf857a0d8a9276666966eea752888f37a23..6b7a6a3d97521e9cc6f3208b7fadd03efabb2eb8 100644 |
--- a/Source/core/events/WheelEvent.cpp |
+++ b/Source/core/events/WheelEvent.cpp |
@@ -30,6 +30,21 @@ |
namespace blink { |
+inline static unsigned convertDeltaMode(const PlatformWheelEvent& event) |
+{ |
+ return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::DOM_DELTA_PAGE : WheelEvent::DOM_DELTA_PIXEL; |
+} |
+ |
+PassRefPtrWillBeRawPtr<WheelEvent> WheelEvent::create(const PlatformWheelEvent& event, PassRefPtrWillBeRawPtr<AbstractView> view) |
+{ |
+ return adoptRefWillBeNoop(new WheelEvent(FloatPoint(event.wheelTicksX(), event.wheelTicksY()), FloatPoint(event.deltaX(), event.deltaY()), |
+ convertDeltaMode(event), view, event.globalPosition(), event.position(), |
+ event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), |
+ MouseEvent::platformModifiersToButtons(event.modifiers()), |
+ event.canScroll(), event.hasPreciseScrollingDeltas(), |
+ static_cast<Event::RailsMode>(event.railsMode()))); |
+} |
+ |
WheelEvent::WheelEvent() |
: m_deltaX(0) |
, m_deltaY(0) |
@@ -86,29 +101,24 @@ bool WheelEvent::isWheelEvent() const |
return true; |
} |
-DEFINE_TRACE(WheelEvent) |
+PassRefPtrWillBeRawPtr<EventDispatchMediator> WheelEvent::createMediator() |
{ |
- MouseEvent::trace(visitor); |
+ return WheelEventDispatchMediator::create(this); |
} |
-inline static unsigned deltaMode(const PlatformWheelEvent& event) |
+DEFINE_TRACE(WheelEvent) |
{ |
- return event.granularity() == ScrollByPageWheelEvent ? WheelEvent::DOM_DELTA_PAGE : WheelEvent::DOM_DELTA_PIXEL; |
+ MouseEvent::trace(visitor); |
} |
-PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> WheelEventDispatchMediator::create(const PlatformWheelEvent& event, PassRefPtrWillBeRawPtr<AbstractView> view) |
+PassRefPtrWillBeRawPtr<WheelEventDispatchMediator> WheelEventDispatchMediator::create(PassRefPtrWillBeRawPtr<WheelEvent> event) |
{ |
- return adoptRefWillBeNoop(new WheelEventDispatchMediator(event, view)); |
+ return adoptRefWillBeNoop(new WheelEventDispatchMediator(event)); |
} |
-WheelEventDispatchMediator::WheelEventDispatchMediator(const PlatformWheelEvent& event, PassRefPtrWillBeRawPtr<AbstractView> view) |
+WheelEventDispatchMediator::WheelEventDispatchMediator(PassRefPtrWillBeRawPtr<WheelEvent> event) |
+ : EventDispatchMediator(event) |
{ |
- setEvent(WheelEvent::create(FloatPoint(event.wheelTicksX(), event.wheelTicksY()), FloatPoint(event.deltaX(), event.deltaY()), |
- deltaMode(event), view, event.globalPosition(), event.position(), |
- event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey(), |
- MouseEvent::platformModifiersToButtons(event.modifiers()), |
- event.canScroll(), event.hasPreciseScrollingDeltas(), |
- static_cast<Event::RailsMode>(event.railsMode()))); |
} |
WheelEvent& WheelEventDispatchMediator::event() const |