OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2011, Google Inc. All rights reserved. | 2 * Copyright (c) 2011, Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
421 | 421 |
422 // This is an animatable scroll. Set the animation in motion using the appro
priate parameters. | 422 // This is an animatable scroll. Set the animation in motion using the appro
priate parameters. |
423 float scrollableSize = static_cast<float>(m_scrollableArea->scrollSize(orien
tation)); | 423 float scrollableSize = static_cast<float>(m_scrollableArea->scrollSize(orien
tation)); |
424 | 424 |
425 PerAxisData& data = (orientation == VerticalScrollbar) ? m_verticalData : m_
horizontalData; | 425 PerAxisData& data = (orientation == VerticalScrollbar) ? m_verticalData : m_
horizontalData; |
426 bool needToScroll = data.updateDataFromParameters(step, delta, scrollableSiz
e, WTF::monotonicallyIncreasingTime(), ¶meters); | 426 bool needToScroll = data.updateDataFromParameters(step, delta, scrollableSiz
e, WTF::monotonicallyIncreasingTime(), ¶meters); |
427 if (needToScroll && !animationTimerActive()) { | 427 if (needToScroll && !animationTimerActive()) { |
428 m_startTime = data.m_startTime; | 428 m_startTime = data.m_startTime; |
429 animationWillStart(); | 429 animationWillStart(); |
430 animationTimerFired(); | 430 animationTimerFired(); |
| 431 scrollableArea()->registerForAnimation(); |
431 } | 432 } |
432 return needToScroll; | 433 return needToScroll; |
433 } | 434 } |
434 | 435 |
435 void ScrollAnimatorNone::scrollToOffsetWithoutAnimation(const FloatPoint& offset
) | 436 void ScrollAnimatorNone::scrollToOffsetWithoutAnimation(const FloatPoint& offset
) |
436 { | 437 { |
437 stopAnimationTimerIfNeeded(); | 438 stopAnimationTimerIfNeeded(); |
438 | 439 |
439 m_horizontalData.reset(); | 440 m_horizontalData.reset(); |
440 *m_horizontalData.m_currentPosition = offset.x(); | 441 *m_horizontalData.m_currentPosition = offset.x(); |
(...skipping 12 matching lines...) Expand all Loading... |
453 { | 454 { |
454 m_animationActive = false; | 455 m_animationActive = false; |
455 } | 456 } |
456 | 457 |
457 void ScrollAnimatorNone::serviceScrollAnimations() | 458 void ScrollAnimatorNone::serviceScrollAnimations() |
458 { | 459 { |
459 if (m_animationActive) | 460 if (m_animationActive) |
460 animationTimerFired(); | 461 animationTimerFired(); |
461 } | 462 } |
462 | 463 |
| 464 bool ScrollAnimatorNone::hasRunningAnimation() const |
| 465 { |
| 466 return m_animationActive; |
| 467 } |
| 468 |
463 void ScrollAnimatorNone::willEndLiveResize() | 469 void ScrollAnimatorNone::willEndLiveResize() |
464 { | 470 { |
465 updateVisibleLengths(); | 471 updateVisibleLengths(); |
466 } | 472 } |
467 | 473 |
468 void ScrollAnimatorNone::didAddVerticalScrollbar(Scrollbar*) | 474 void ScrollAnimatorNone::didAddVerticalScrollbar(Scrollbar*) |
469 { | 475 { |
470 updateVisibleLengths(); | 476 updateVisibleLengths(); |
471 } | 477 } |
472 | 478 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 return m_animationActive; | 522 return m_animationActive; |
517 } | 523 } |
518 | 524 |
519 void ScrollAnimatorNone::stopAnimationTimerIfNeeded() | 525 void ScrollAnimatorNone::stopAnimationTimerIfNeeded() |
520 { | 526 { |
521 if (animationTimerActive()) | 527 if (animationTimerActive()) |
522 m_animationActive = false; | 528 m_animationActive = false; |
523 } | 529 } |
524 | 530 |
525 } // namespace blink | 531 } // namespace blink |
OLD | NEW |