| 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 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 scrollableArea()->registerForAnimation(); |
| 432 } | 432 } |
| 433 return ScrollResultOneDimensional(needToScroll); | 433 return ScrollResultOneDimensional(needToScroll); |
| 434 } | 434 } |
| 435 | 435 |
| 436 void ScrollAnimatorNone::scrollToOffsetWithoutAnimation(const FloatPoint& offset
) | 436 void ScrollAnimatorNone::scrollToOffsetWithoutAnimation(const FloatPoint& offset
, ScrollType scrollType) |
| 437 { | 437 { |
| 438 stopAnimationTimerIfNeeded(); | 438 stopAnimationTimerIfNeeded(); |
| 439 | 439 |
| 440 m_horizontalData.reset(); | 440 m_horizontalData.reset(); |
| 441 *m_horizontalData.m_currentPosition = offset.x(); | 441 *m_horizontalData.m_currentPosition = offset.x(); |
| 442 m_horizontalData.m_desiredPosition = offset.x(); | 442 m_horizontalData.m_desiredPosition = offset.x(); |
| 443 m_currentPosX = offset.x(); | 443 m_currentPosX = offset.x(); |
| 444 | 444 |
| 445 m_verticalData.reset(); | 445 m_verticalData.reset(); |
| 446 *m_verticalData.m_currentPosition = offset.y(); | 446 *m_verticalData.m_currentPosition = offset.y(); |
| 447 m_verticalData.m_desiredPosition = offset.y(); | 447 m_verticalData.m_desiredPosition = offset.y(); |
| 448 m_currentPosY = offset.y(); | 448 m_currentPosY = offset.y(); |
| 449 | 449 |
| 450 notifyPositionChanged(); | 450 notifyPositionChanged(scrollType); |
| 451 } | 451 } |
| 452 | 452 |
| 453 void ScrollAnimatorNone::cancelAnimations() | 453 void ScrollAnimatorNone::cancelAnimations() |
| 454 { | 454 { |
| 455 m_animationActive = false; | 455 m_animationActive = false; |
| 456 } | 456 } |
| 457 | 457 |
| 458 void ScrollAnimatorNone::serviceScrollAnimations() | 458 void ScrollAnimatorNone::serviceScrollAnimations() |
| 459 { | 459 { |
| 460 if (m_animationActive) | 460 if (m_animationActive) |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 continueAnimation = true; | 503 continueAnimation = true; |
| 504 if (m_verticalData.m_startTime && m_verticalData.animateScroll(currentTime)) | 504 if (m_verticalData.m_startTime && m_verticalData.animateScroll(currentTime)) |
| 505 continueAnimation = true; | 505 continueAnimation = true; |
| 506 | 506 |
| 507 if (continueAnimation) | 507 if (continueAnimation) |
| 508 startNextTimer(); | 508 startNextTimer(); |
| 509 else | 509 else |
| 510 m_animationActive = false; | 510 m_animationActive = false; |
| 511 | 511 |
| 512 TRACE_EVENT0("blink", "ScrollAnimatorNone::notifyPositionChanged"); | 512 TRACE_EVENT0("blink", "ScrollAnimatorNone::notifyPositionChanged"); |
| 513 notifyPositionChanged(); | 513 notifyPositionChanged(UserScroll); |
| 514 | 514 |
| 515 if (!continueAnimation) | 515 if (!continueAnimation) |
| 516 animationDidFinish(); | 516 animationDidFinish(); |
| 517 } | 517 } |
| 518 | 518 |
| 519 void ScrollAnimatorNone::startNextTimer() | 519 void ScrollAnimatorNone::startNextTimer() |
| 520 { | 520 { |
| 521 if (scrollableArea()->scheduleAnimation()) | 521 if (scrollableArea()->scheduleAnimation()) |
| 522 m_animationActive = true; | 522 m_animationActive = true; |
| 523 } | 523 } |
| 524 | 524 |
| 525 bool ScrollAnimatorNone::animationTimerActive() | 525 bool ScrollAnimatorNone::animationTimerActive() |
| 526 { | 526 { |
| 527 return m_animationActive; | 527 return m_animationActive; |
| 528 } | 528 } |
| 529 | 529 |
| 530 void ScrollAnimatorNone::stopAnimationTimerIfNeeded() | 530 void ScrollAnimatorNone::stopAnimationTimerIfNeeded() |
| 531 { | 531 { |
| 532 if (animationTimerActive()) | 532 if (animationTimerActive()) |
| 533 m_animationActive = false; | 533 m_animationActive = false; |
| 534 } | 534 } |
| 535 | 535 |
| 536 } // namespace blink | 536 } // namespace blink |
| OLD | NEW |