| 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 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 313 { | 313 { |
| 314 } | 314 } |
| 315 | 315 |
| 316 ~WebScrollbarPartAnimationTimer() {} | 316 ~WebScrollbarPartAnimationTimer() {} |
| 317 | 317 |
| 318 void start() | 318 void start() |
| 319 { | 319 { |
| 320 m_startTime = WTF::currentTime(); | 320 m_startTime = WTF::currentTime(); |
| 321 // Set the framerate of the animation. NSAnimation uses a default | 321 // Set the framerate of the animation. NSAnimation uses a default |
| 322 // framerate of 60 Hz, so use that here. | 322 // framerate of 60 Hz, so use that here. |
| 323 m_timer.startRepeating(1.0 / 60.0, FROM_HERE); | 323 m_timer.startRepeating(1.0 / 60.0, BLINK_FROM_HERE); |
| 324 } | 324 } |
| 325 | 325 |
| 326 void stop() | 326 void stop() |
| 327 { | 327 { |
| 328 m_timer.stop(); | 328 m_timer.stop(); |
| 329 } | 329 } |
| 330 | 330 |
| 331 void setDuration(CFTimeInterval duration) | 331 void setDuration(CFTimeInterval duration) |
| 332 { | 332 { |
| 333 m_duration = duration; | 333 m_duration = duration; |
| (...skipping 781 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1115 // If m_needsScrollerStyleUpdate is true, then the page is restoring from th
e page cache, and | 1115 // If m_needsScrollerStyleUpdate is true, then the page is restoring from th
e page cache, and |
| 1116 // a relayout will happen on its own. Otherwise, we must initiate a re-layou
t ourselves. | 1116 // a relayout will happen on its own. Otherwise, we must initiate a re-layou
t ourselves. |
| 1117 if (!m_needsScrollerStyleUpdate) | 1117 if (!m_needsScrollerStyleUpdate) |
| 1118 scrollableArea()->scrollbarStyleChanged(); | 1118 scrollableArea()->scrollbarStyleChanged(); |
| 1119 | 1119 |
| 1120 m_needsScrollerStyleUpdate = false; | 1120 m_needsScrollerStyleUpdate = false; |
| 1121 } | 1121 } |
| 1122 | 1122 |
| 1123 void ScrollAnimatorMac::startScrollbarPaintTimer() | 1123 void ScrollAnimatorMac::startScrollbarPaintTimer() |
| 1124 { | 1124 { |
| 1125 m_initialScrollbarPaintTimer.startOneShot(0.1, FROM_HERE); | 1125 m_initialScrollbarPaintTimer.startOneShot(0.1, BLINK_FROM_HERE); |
| 1126 } | 1126 } |
| 1127 | 1127 |
| 1128 bool ScrollAnimatorMac::scrollbarPaintTimerIsActive() const | 1128 bool ScrollAnimatorMac::scrollbarPaintTimerIsActive() const |
| 1129 { | 1129 { |
| 1130 return m_initialScrollbarPaintTimer.isActive(); | 1130 return m_initialScrollbarPaintTimer.isActive(); |
| 1131 } | 1131 } |
| 1132 | 1132 |
| 1133 void ScrollAnimatorMac::stopScrollbarPaintTimer() | 1133 void ScrollAnimatorMac::stopScrollbarPaintTimer() |
| 1134 { | 1134 { |
| 1135 m_initialScrollbarPaintTimer.stop(); | 1135 m_initialScrollbarPaintTimer.stop(); |
| 1136 } | 1136 } |
| 1137 | 1137 |
| 1138 void ScrollAnimatorMac::initialScrollbarPaintTimerFired(Timer<ScrollAnimatorMac>
*) | 1138 void ScrollAnimatorMac::initialScrollbarPaintTimerFired(Timer<ScrollAnimatorMac>
*) |
| 1139 { | 1139 { |
| 1140 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) { | 1140 if (ScrollbarThemeMacCommon::isOverlayAPIAvailable()) { |
| 1141 // To force the scrollbars to flash, we have to call hide first. Otherwi
se, the ScrollbarPainterController | 1141 // To force the scrollbars to flash, we have to call hide first. Otherwi
se, the ScrollbarPainterController |
| 1142 // might think that the scrollbars are already showing and bail early. | 1142 // might think that the scrollbars are already showing and bail early. |
| 1143 [m_scrollbarPainterController.get() hideOverlayScrollers]; | 1143 [m_scrollbarPainterController.get() hideOverlayScrollers]; |
| 1144 [m_scrollbarPainterController.get() flashScrollers]; | 1144 [m_scrollbarPainterController.get() flashScrollers]; |
| 1145 } | 1145 } |
| 1146 } | 1146 } |
| 1147 | 1147 |
| 1148 void ScrollAnimatorMac::sendContentAreaScrolledSoon(const FloatSize& delta) | 1148 void ScrollAnimatorMac::sendContentAreaScrolledSoon(const FloatSize& delta) |
| 1149 { | 1149 { |
| 1150 m_contentAreaScrolledTimerScrollDelta = delta; | 1150 m_contentAreaScrolledTimerScrollDelta = delta; |
| 1151 | 1151 |
| 1152 if (!m_sendContentAreaScrolledTimer.isActive()) | 1152 if (!m_sendContentAreaScrolledTimer.isActive()) |
| 1153 m_sendContentAreaScrolledTimer.startOneShot(0, FROM_HERE); | 1153 m_sendContentAreaScrolledTimer.startOneShot(0, BLINK_FROM_HERE); |
| 1154 } | 1154 } |
| 1155 | 1155 |
| 1156 void ScrollAnimatorMac::sendContentAreaScrolledTimerFired(Timer<ScrollAnimatorMa
c>*) | 1156 void ScrollAnimatorMac::sendContentAreaScrolledTimerFired(Timer<ScrollAnimatorMa
c>*) |
| 1157 { | 1157 { |
| 1158 if (supportsContentAreaScrolledInDirection()) { | 1158 if (supportsContentAreaScrolledInDirection()) { |
| 1159 [m_scrollbarPainterController.get() contentAreaScrolledInDirection:NSMak
ePoint(m_contentAreaScrolledTimerScrollDelta.width(), m_contentAreaScrolledTimer
ScrollDelta.height())]; | 1159 [m_scrollbarPainterController.get() contentAreaScrolledInDirection:NSMak
ePoint(m_contentAreaScrolledTimerScrollDelta.width(), m_contentAreaScrolledTimer
ScrollDelta.height())]; |
| 1160 m_contentAreaScrolledTimerScrollDelta = FloatSize(); | 1160 m_contentAreaScrolledTimerScrollDelta = FloatSize(); |
| 1161 } else | 1161 } else |
| 1162 [m_scrollbarPainterController.get() contentAreaScrolled]; | 1162 [m_scrollbarPainterController.get() contentAreaScrolled]; |
| 1163 } | 1163 } |
| 1164 | 1164 |
| 1165 void ScrollAnimatorMac::setVisibleScrollerThumbRect(const IntRect& scrollerThumb
) | 1165 void ScrollAnimatorMac::setVisibleScrollerThumbRect(const IntRect& scrollerThumb
) |
| 1166 { | 1166 { |
| 1167 IntRect rectInViewCoordinates = scrollerThumb; | 1167 IntRect rectInViewCoordinates = scrollerThumb; |
| 1168 if (Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar()) | 1168 if (Scrollbar* verticalScrollbar = m_scrollableArea->verticalScrollbar()) |
| 1169 rectInViewCoordinates = verticalScrollbar->convertToContainingView(scrol
lerThumb); | 1169 rectInViewCoordinates = verticalScrollbar->convertToContainingView(scrol
lerThumb); |
| 1170 | 1170 |
| 1171 if (rectInViewCoordinates == m_visibleScrollerThumbRect) | 1171 if (rectInViewCoordinates == m_visibleScrollerThumbRect) |
| 1172 return; | 1172 return; |
| 1173 | 1173 |
| 1174 m_visibleScrollerThumbRect = rectInViewCoordinates; | 1174 m_visibleScrollerThumbRect = rectInViewCoordinates; |
| 1175 } | 1175 } |
| 1176 | 1176 |
| 1177 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { | 1177 bool ScrollAnimatorMac::canUseCoordinatedScrollbar() { |
| 1178 return ScrollbarThemeMacCommon::isOverlayAPIAvailable(); | 1178 return ScrollbarThemeMacCommon::isOverlayAPIAvailable(); |
| 1179 } | 1179 } |
| 1180 | 1180 |
| 1181 } // namespace blink | 1181 } // namespace blink |
| OLD | NEW |