| 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 710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 721 [m_verticalScrollbarPainterDelegate.get() invalidate]; | 721 [m_verticalScrollbarPainterDelegate.get() invalidate]; |
| 722 [m_scrollAnimationHelperDelegate.get() invalidate]; | 722 [m_scrollAnimationHelperDelegate.get() invalidate]; |
| 723 END_BLOCK_OBJC_EXCEPTIONS; | 723 END_BLOCK_OBJC_EXCEPTIONS; |
| 724 } | 724 } |
| 725 m_initialScrollbarPaintTimer.stop(); | 725 m_initialScrollbarPaintTimer.stop(); |
| 726 m_sendContentAreaScrolledTimer.stop(); | 726 m_sendContentAreaScrolledTimer.stop(); |
| 727 } | 727 } |
| 728 | 728 |
| 729 ScrollResultOneDimensional ScrollAnimatorMac::userScroll(ScrollbarOrientation or
ientation, ScrollGranularity granularity, float step, float delta) | 729 ScrollResultOneDimensional ScrollAnimatorMac::userScroll(ScrollbarOrientation or
ientation, ScrollGranularity granularity, float step, float delta) |
| 730 { | 730 { |
| 731 bool scrollAnimationEnabledForSystem = static_cast<ScrollbarThemeMacCommon&>
( | |
| 732 ScrollbarTheme::theme()) | |
| 733 .scrollAnimationEnabledForSystem(
); | |
| 734 m_haveScrolledSincePageLoad = true; | 731 m_haveScrolledSincePageLoad = true; |
| 735 | 732 |
| 736 if (!scrollAnimationEnabledForSystem || !m_scrollableArea->scrollAnimatorEna
bled()) | 733 if (!m_scrollableArea->scrollAnimatorEnabled()) |
| 737 return ScrollAnimatorBase::userScroll(orientation, granularity, step, de
lta); | 734 return ScrollAnimatorBase::userScroll(orientation, granularity, step, de
lta); |
| 738 | 735 |
| 739 if (granularity == ScrollByPixel || granularity == ScrollByPrecisePixel) | 736 if (granularity == ScrollByPixel || granularity == ScrollByPrecisePixel) |
| 740 return ScrollAnimatorBase::userScroll(orientation, granularity, step, de
lta); | 737 return ScrollAnimatorBase::userScroll(orientation, granularity, step, de
lta); |
| 741 | 738 |
| 742 float currentPos = orientation == HorizontalScrollbar ? m_currentPosX : m_cu
rrentPosY; | 739 float currentPos = orientation == HorizontalScrollbar ? m_currentPosX : m_cu
rrentPosY; |
| 743 float usedPixelDelta = computeDeltaToConsume(orientation, step * delta); | 740 float usedPixelDelta = computeDeltaToConsume(orientation, step * delta); |
| 744 float newPos = currentPos + usedPixelDelta; | 741 float newPos = currentPos + usedPixelDelta; |
| 745 if (currentPos == newPos) | 742 if (currentPos == newPos) |
| 746 return ScrollResultOneDimensional(false); | 743 return ScrollResultOneDimensional(false); |
| (...skipping 445 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 return; | 1189 return; |
| 1193 | 1190 |
| 1194 m_visibleScrollerThumbRect = rectInViewCoordinates; | 1191 m_visibleScrollerThumbRect = rectInViewCoordinates; |
| 1195 } | 1192 } |
| 1196 | 1193 |
| 1197 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { | 1194 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { |
| 1198 return ScrollbarThemeMacCommon::isOverlayAPIAvailable(); | 1195 return ScrollbarThemeMacCommon::isOverlayAPIAvailable(); |
| 1199 } | 1196 } |
| 1200 | 1197 |
| 1201 } // namespace blink | 1198 } // namespace blink |
| OLD | NEW |