| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2010, 2011 Apple Inc. All rights reserved. | 2 * Copyright (C) 2010, 2011 Apple 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 | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
| 8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
| 9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
| 10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
| (...skipping 853 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 864 return; | 864 return; |
| 865 [m_scrollbarPainterController.get() windowOrderedIn]; | 865 [m_scrollbarPainterController.get() windowOrderedIn]; |
| 866 } | 866 } |
| 867 | 867 |
| 868 void ScrollAnimatorMac::contentAreaDidHide() const { | 868 void ScrollAnimatorMac::contentAreaDidHide() const { |
| 869 if (!getScrollableArea()->scrollbarsCanBeActive()) | 869 if (!getScrollableArea()->scrollbarsCanBeActive()) |
| 870 return; | 870 return; |
| 871 [m_scrollbarPainterController.get() windowOrderedOut]; | 871 [m_scrollbarPainterController.get() windowOrderedOut]; |
| 872 } | 872 } |
| 873 | 873 |
| 874 void ScrollAnimatorMac::didBeginScrollGesture() const { | |
| 875 if (!getScrollableArea()->scrollbarsCanBeActive()) | |
| 876 return; | |
| 877 [m_scrollbarPainterController.get() beginScrollGesture]; | |
| 878 } | |
| 879 | |
| 880 void ScrollAnimatorMac::didEndScrollGesture() const { | |
| 881 if (!getScrollableArea()->scrollbarsCanBeActive()) | |
| 882 return; | |
| 883 [m_scrollbarPainterController.get() endScrollGesture]; | |
| 884 } | |
| 885 | |
| 886 void ScrollAnimatorMac::mayBeginScrollGesture() const { | |
| 887 if (!getScrollableArea()->scrollbarsCanBeActive()) | |
| 888 return; | |
| 889 [m_scrollbarPainterController.get() beginScrollGesture]; | |
| 890 [m_scrollbarPainterController.get() contentAreaScrolled]; | |
| 891 } | |
| 892 | |
| 893 void ScrollAnimatorMac::finishCurrentScrollAnimations() { | 874 void ScrollAnimatorMac::finishCurrentScrollAnimations() { |
| 894 [m_scrollbarPainterController.get() hideOverlayScrollers]; | 875 [m_scrollbarPainterController.get() hideOverlayScrollers]; |
| 895 } | 876 } |
| 896 | 877 |
| 897 void ScrollAnimatorMac::didAddVerticalScrollbar(Scrollbar& scrollbar) { | 878 void ScrollAnimatorMac::didAddVerticalScrollbar(Scrollbar& scrollbar) { |
| 898 ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar); | 879 ScrollbarPainter painter = scrollbarPainterForScrollbar(scrollbar); |
| 899 if (!painter) | 880 if (!painter) |
| 900 return; | 881 return; |
| 901 | 882 |
| 902 ASSERT(!m_verticalScrollbarPainterDelegate); | 883 ASSERT(!m_verticalScrollbarPainterDelegate); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 965 [m_verticalScrollbarPainterDelegate.get() updateVisibilityImmediately:show]; | 946 [m_verticalScrollbarPainterDelegate.get() updateVisibilityImmediately:show]; |
| 966 [m_horizontalScrollbarPainterDelegate.get() updateVisibilityImmediately:show]; | 947 [m_horizontalScrollbarPainterDelegate.get() updateVisibilityImmediately:show]; |
| 967 return true; | 948 return true; |
| 968 } | 949 } |
| 969 | 950 |
| 970 void ScrollAnimatorMac::cancelAnimation() { | 951 void ScrollAnimatorMac::cancelAnimation() { |
| 971 [m_scrollAnimationHelper.get() _stopRun]; | 952 [m_scrollAnimationHelper.get() _stopRun]; |
| 972 m_haveScrolledSincePageLoad = false; | 953 m_haveScrolledSincePageLoad = false; |
| 973 } | 954 } |
| 974 | 955 |
| 975 void ScrollAnimatorMac::handleWheelEventPhase(PlatformWheelEventPhase phase) { | |
| 976 // This may not have been set to true yet if the wheel event was handled by | |
| 977 // the ScrollingTree, | |
| 978 // So set it to true here. | |
| 979 m_haveScrolledSincePageLoad = true; | |
| 980 | |
| 981 if (phase == PlatformWheelEventPhaseBegan) | |
| 982 didBeginScrollGesture(); | |
| 983 else if (phase == PlatformWheelEventPhaseEnded || | |
| 984 phase == PlatformWheelEventPhaseCancelled) | |
| 985 didEndScrollGesture(); | |
| 986 else if (phase == PlatformWheelEventPhaseMayBegin) | |
| 987 mayBeginScrollGesture(); | |
| 988 } | |
| 989 | |
| 990 void ScrollAnimatorMac::updateScrollerStyle() { | 956 void ScrollAnimatorMac::updateScrollerStyle() { |
| 991 if (!getScrollableArea()->scrollbarsCanBeActive()) { | 957 if (!getScrollableArea()->scrollbarsCanBeActive()) { |
| 992 m_needsScrollerStyleUpdate = true; | 958 m_needsScrollerStyleUpdate = true; |
| 993 return; | 959 return; |
| 994 } | 960 } |
| 995 | 961 |
| 996 ScrollbarThemeMac* macTheme = macOverlayScrollbarTheme(); | 962 ScrollbarThemeMac* macTheme = macOverlayScrollbarTheme(); |
| 997 if (!macTheme) { | 963 if (!macTheme) { |
| 998 m_needsScrollerStyleUpdate = false; | 964 m_needsScrollerStyleUpdate = false; |
| 999 return; | 965 return; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1114 rectInViewCoordinates = | 1080 rectInViewCoordinates = |
| 1115 verticalScrollbar->convertToContainingWidget(scrollerThumb); | 1081 verticalScrollbar->convertToContainingWidget(scrollerThumb); |
| 1116 | 1082 |
| 1117 if (rectInViewCoordinates == m_visibleScrollerThumbRect) | 1083 if (rectInViewCoordinates == m_visibleScrollerThumbRect) |
| 1118 return; | 1084 return; |
| 1119 | 1085 |
| 1120 m_visibleScrollerThumbRect = rectInViewCoordinates; | 1086 m_visibleScrollerThumbRect = rectInViewCoordinates; |
| 1121 } | 1087 } |
| 1122 | 1088 |
| 1123 } // namespace blink | 1089 } // namespace blink |
| OLD | NEW |