Changeset 96639 in webkit


Ignore:
Timestamp:
Oct 4, 2011 1:44:05 PM (13 years ago)
Author:
andersca@apple.com
Message:

Use const PlatformWheelEvent references where possible
https://bugs.webkit.org/show_bug.cgi?id=69367

Reviewed by Sam Weinig.

  • page/EventHandler.cpp:

(WebCore::EventHandler::handleWheelEvent):

  • platform/ScrollAnimator.cpp:

(WebCore::ScrollAnimator::handleWheelEvent):

  • platform/ScrollAnimator.h:
  • platform/ScrollView.cpp:

(WebCore::ScrollView::wheelEvent):

  • platform/ScrollView.h:
  • platform/ScrollableArea.cpp:

(WebCore::ScrollableArea::handleWheelEvent):

  • platform/ScrollableArea.h:
  • platform/chromium/ScrollAnimatorChromiumMac.h:
  • platform/chromium/ScrollAnimatorChromiumMac.mm:

(WebCore::ScrollAnimatorChromiumMac::handleWheelEvent):

  • platform/mac/ScrollAnimatorMac.h:
  • platform/mac/ScrollAnimatorMac.mm:

(WebCore::isScrollingLeftAndShouldNotRubberBand):
(WebCore::isScrollingRightAndShouldNotRubberBand):
(WebCore::ScrollAnimatorMac::handleWheelEvent):
(WebCore::ScrollAnimatorMac::smoothScrollWithEvent):

Location:
trunk/Source/WebCore
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r96638 r96639  
     12011-10-04  Anders Carlsson  <andersca@apple.com>
     2
     3        Use const PlatformWheelEvent references where possible
     4        https://bugs.webkit.org/show_bug.cgi?id=69367
     5
     6        Reviewed by Sam Weinig.
     7
     8        * page/EventHandler.cpp:
     9        (WebCore::EventHandler::handleWheelEvent):
     10        * platform/ScrollAnimator.cpp:
     11        (WebCore::ScrollAnimator::handleWheelEvent):
     12        * platform/ScrollAnimator.h:
     13        * platform/ScrollView.cpp:
     14        (WebCore::ScrollView::wheelEvent):
     15        * platform/ScrollView.h:
     16        * platform/ScrollableArea.cpp:
     17        (WebCore::ScrollableArea::handleWheelEvent):
     18        * platform/ScrollableArea.h:
     19        * platform/chromium/ScrollAnimatorChromiumMac.h:
     20        * platform/chromium/ScrollAnimatorChromiumMac.mm:
     21        (WebCore::ScrollAnimatorChromiumMac::handleWheelEvent):
     22        * platform/mac/ScrollAnimatorMac.h:
     23        * platform/mac/ScrollAnimatorMac.mm:
     24        (WebCore::isScrollingLeftAndShouldNotRubberBand):
     25        (WebCore::isScrollingRightAndShouldNotRubberBand):
     26        (WebCore::ScrollAnimatorMac::handleWheelEvent):
     27        (WebCore::ScrollAnimatorMac::smoothScrollWithEvent):
     28
    1292011-10-04  Andreas Kling  <kling@webkit.org>
    230
  • trunk/Source/WebCore/page/EventHandler.cpp

    r96633 r96639  
    21682168    }
    21692169
     2170    // FIXME: This should not mutate the event.
    21702171    if (shouldTurnVerticalTicksIntoHorizontal(result))
    21712172        e.turnVerticalTicksIntoHorizontal();
  • trunk/Source/WebCore/platform/ScrollAnimator.cpp

    r96633 r96639  
    8282}
    8383
    84 bool ScrollAnimator::handleWheelEvent(PlatformWheelEvent& e)
     84bool ScrollAnimator::handleWheelEvent(const PlatformWheelEvent& e)
    8585{
    8686    Scrollbar* horizontalScrollbar = m_scrollableArea->horizontalScrollbar();
  • trunk/Source/WebCore/platform/ScrollAnimator.h

    r96561 r96639  
    6464    virtual void setIsActive() { }
    6565
    66     virtual bool handleWheelEvent(PlatformWheelEvent&);
     66    virtual bool handleWheelEvent(const PlatformWheelEvent&);
    6767#if ENABLE(GESTURE_EVENTS)
    6868    virtual void handleGestureEvent(const PlatformGestureEvent&);
  • trunk/Source/WebCore/platform/ScrollView.cpp

    r96561 r96639  
    798798}
    799799
    800 bool ScrollView::wheelEvent(PlatformWheelEvent& e)
     800bool ScrollView::wheelEvent(const PlatformWheelEvent& e)
    801801{
    802802    // We don't allow mouse wheeling to happen in a ScrollView that has had its scrollbars explicitly disabled.
  • trunk/Source/WebCore/platform/ScrollView.h

    r96561 r96639  
    235235    // On Mac the underlying NSScrollView just does the scrolling, but on other platforms
    236236    // (like Windows), we need this function in order to do the scroll ourselves.
    237     bool wheelEvent(PlatformWheelEvent&);
     237    bool wheelEvent(const PlatformWheelEvent&);
    238238#if ENABLE(GESTURE_EVENTS)
    239239    void gestureEvent(const PlatformGestureEvent&);
  • trunk/Source/WebCore/platform/ScrollableArea.cpp

    r96561 r96639  
    124124}
    125125
    126 bool ScrollableArea::handleWheelEvent(PlatformWheelEvent& wheelEvent)
     126bool ScrollableArea::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
    127127{
    128128    return scrollAnimator()->handleWheelEvent(wheelEvent);
  • trunk/Source/WebCore/platform/ScrollableArea.h

    r96561 r96639  
    5353    void scrollToYOffsetWithoutAnimation(float x);
    5454
    55     bool handleWheelEvent(PlatformWheelEvent&);
     55    bool handleWheelEvent(const PlatformWheelEvent&);
    5656#if ENABLE(GESTURE_EVENTS)
    5757    void handleGestureEvent(const PlatformGestureEvent&);
  • trunk/Source/WebCore/platform/chromium/ScrollAnimatorChromiumMac.h

    r96561 r96639  
    6060
    6161#if ENABLE(RUBBER_BANDING)
    62     virtual bool handleWheelEvent(PlatformWheelEvent&) OVERRIDE;
     62    virtual bool handleWheelEvent(const PlatformWheelEvent&) OVERRIDE;
    6363#if ENABLE(GESTURE_EVENTS)
    6464    virtual void handleGestureEvent(const PlatformGestureEvent&);
  • trunk/Source/WebCore/platform/chromium/ScrollAnimatorChromiumMac.mm

    r96633 r96639  
    782782}
    783783
    784 bool ScrollAnimatorChromiumMac::handleWheelEvent(PlatformWheelEvent& wheelEvent)
     784bool ScrollAnimatorChromiumMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
    785785{
    786786    m_haveScrolledSincePageLoad = true;
  • trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.h

    r96561 r96639  
    6363
    6464#if ENABLE(RUBBER_BANDING)
    65     virtual bool handleWheelEvent(PlatformWheelEvent&) OVERRIDE;
     65    virtual bool handleWheelEvent(const PlatformWheelEvent&) OVERRIDE;
    6666#if ENABLE(GESTURE_EVENTS)
    6767    virtual void handleGestureEvent(const PlatformGestureEvent&);
     
    138138    void snapRubberBand();
    139139    void snapRubberBandTimerFired(Timer<ScrollAnimatorMac>*);
    140     void smoothScrollWithEvent(PlatformWheelEvent&);
     140    void smoothScrollWithEvent(const PlatformWheelEvent&);
    141141    void beginScrollGesture();
    142142    void endScrollGesture();
  • trunk/Source/WebCore/platform/mac/ScrollAnimatorMac.mm

    r96633 r96639  
    783783}
    784784
    785 static inline bool isScrollingLeftAndShouldNotRubberBand(PlatformWheelEvent& wheelEvent, ScrollableArea* scrollableArea)
     785static inline bool isScrollingLeftAndShouldNotRubberBand(const PlatformWheelEvent& wheelEvent, ScrollableArea* scrollableArea)
    786786{
    787787    return wheelEvent.deltaX() > 0 && !scrollableArea->shouldRubberBandInDirection(ScrollLeft);
    788788}
    789789
    790 static inline bool isScrollingRightAndShouldNotRubberBand(PlatformWheelEvent& wheelEvent, ScrollableArea* scrollableArea)
     790static inline bool isScrollingRightAndShouldNotRubberBand(const PlatformWheelEvent& wheelEvent, ScrollableArea* scrollableArea)
    791791{
    792792    return wheelEvent.deltaX() < 0 && !scrollableArea->shouldRubberBandInDirection(ScrollRight);
    793793}
    794794
    795 bool ScrollAnimatorMac::handleWheelEvent(PlatformWheelEvent& wheelEvent)
     795bool ScrollAnimatorMac::handleWheelEvent(const PlatformWheelEvent& wheelEvent)
    796796{
    797797    m_haveScrolledSincePageLoad = true;
     
    924924}
    925925
    926 void ScrollAnimatorMac::smoothScrollWithEvent(PlatformWheelEvent& wheelEvent)
     926void ScrollAnimatorMac::smoothScrollWithEvent(const PlatformWheelEvent& wheelEvent)
    927927{
    928928    m_haveScrolledSincePageLoad = true;
Note: See TracChangeset for help on using the changeset viewer.