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 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1181 return; | 1178 return; |
1182 | 1179 |
1183 m_visibleScrollerThumbRect = rectInViewCoordinates; | 1180 m_visibleScrollerThumbRect = rectInViewCoordinates; |
1184 } | 1181 } |
1185 | 1182 |
1186 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { | 1183 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { |
1187 return ScrollbarThemeMacCommon::isOverlayAPIAvailable(); | 1184 return ScrollbarThemeMacCommon::isOverlayAPIAvailable(); |
1188 } | 1185 } |
1189 | 1186 |
1190 } // namespace blink | 1187 } // namespace blink |
OLD | NEW |