| 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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 | 122 |
| 123 - (NSRect)bounds | 123 - (NSRect)bounds |
| 124 { | 124 { |
| 125 if (!_animator) | 125 if (!_animator) |
| 126 return NSZeroRect; | 126 return NSZeroRect; |
| 127 | 127 |
| 128 blink::FloatPoint currentPosition = _animator->currentPosition(); | 128 blink::FloatPoint currentPosition = _animator->currentPosition(); |
| 129 return NSMakeRect(currentPosition.x(), currentPosition.y(), 0, 0); | 129 return NSMakeRect(currentPosition.x(), currentPosition.y(), 0, 0); |
| 130 } | 130 } |
| 131 | 131 |
| 132 - (void)_immediateScrollToPoint:(NSPoint)newPosition | |
| 133 { | |
| 134 if (!_animator) | |
| 135 return; | |
| 136 _animator->immediateScrollToPointForScrollAnimation(newPosition); | |
| 137 } | |
| 138 | |
| 139 - (NSPoint)_pixelAlignProposedScrollPosition:(NSPoint)newOrigin | 132 - (NSPoint)_pixelAlignProposedScrollPosition:(NSPoint)newOrigin |
| 140 { | 133 { |
| 141 return newOrigin; | 134 return newOrigin; |
| 142 } | 135 } |
| 143 | 136 |
| 144 - (NSSize)convertSizeToBase:(NSSize)size | 137 - (NSSize)convertSizeToBase:(NSSize)size |
| 145 { | 138 { |
| 146 return abs(size); | 139 return abs(size); |
| 147 } | 140 } |
| 148 | 141 |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 return; | 755 return; |
| 763 | 756 |
| 764 FloatSize delta = FloatSize(adjustedPosition.x() - m_currentPosX, adjustedPo
sition.y() - m_currentPosY); | 757 FloatSize delta = FloatSize(adjustedPosition.x() - m_currentPosX, adjustedPo
sition.y() - m_currentPosY); |
| 765 | 758 |
| 766 m_currentPosX = adjustedPosition.x(); | 759 m_currentPosX = adjustedPosition.x(); |
| 767 m_currentPosY = adjustedPosition.y(); | 760 m_currentPosY = adjustedPosition.y(); |
| 768 notifyContentAreaScrolled(delta); | 761 notifyContentAreaScrolled(delta); |
| 769 notifyPositionChanged(); | 762 notifyPositionChanged(); |
| 770 } | 763 } |
| 771 | 764 |
| 772 void ScrollAnimatorMac::immediateScrollToPointForScrollAnimation(const FloatPoin
t& newPosition) | |
| 773 { | |
| 774 ASSERT(m_scrollAnimationHelper); | |
| 775 immediateScrollTo(newPosition); | |
| 776 } | |
| 777 | |
| 778 void ScrollAnimatorMac::contentAreaWillPaint() const | 765 void ScrollAnimatorMac::contentAreaWillPaint() const |
| 779 { | 766 { |
| 780 if (!scrollableArea()->scrollbarsCanBeActive()) | 767 if (!scrollableArea()->scrollbarsCanBeActive()) |
| 781 return; | 768 return; |
| 782 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) | 769 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) |
| 783 [m_scrollbarPainterController.get() contentAreaWillDraw]; | 770 [m_scrollbarPainterController.get() contentAreaWillDraw]; |
| 784 } | 771 } |
| 785 | 772 |
| 786 void ScrollAnimatorMac::mouseEnteredContentArea() const | 773 void ScrollAnimatorMac::mouseEnteredContentArea() const |
| 787 { | 774 { |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1167 return; | 1154 return; |
| 1168 | 1155 |
| 1169 m_visibleScrollerThumbRect = rectInViewCoordinates; | 1156 m_visibleScrollerThumbRect = rectInViewCoordinates; |
| 1170 } | 1157 } |
| 1171 | 1158 |
| 1172 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { | 1159 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { |
| 1173 return ScrollbarThemeMacCommon::isOverlayAPIAvailable(); | 1160 return ScrollbarThemeMacCommon::isOverlayAPIAvailable(); |
| 1174 } | 1161 } |
| 1175 | 1162 |
| 1176 } // namespace blink | 1163 } // namespace blink |
| OLD | NEW |