Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: third_party/WebKit/Source/platform/scroll/ScrollableArea.cpp

Issue 2826893003: Remove ScrollableArea::GetFrameViewBase and move ScheduleAnimation into subclasses. (Closed)
Patch Set: Remove UNREACHED Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2010, Google Inc. All rights reserved. 2 * Copyright (c) 2010, Google Inc. All rights reserved.
3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved. 3 * Copyright (C) 2008, 2011 Apple Inc. All Rights Reserved.
4 * 4 *
5 * Redistribution and use in source and binary forms, with or without 5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are 6 * modification, are permitted provided that the following conditions are
7 * met: 7 * met:
8 * 8 *
9 * * Redistributions of source code must retain the above copyright 9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 475 matching lines...) Expand 10 before | Expand all | Expand 10 after
486 void ScrollableArea::LayerForScrollingDidChange( 486 void ScrollableArea::LayerForScrollingDidChange(
487 CompositorAnimationTimeline* timeline) { 487 CompositorAnimationTimeline* timeline) {
488 if (ProgrammaticScrollAnimator* programmatic_scroll_animator = 488 if (ProgrammaticScrollAnimator* programmatic_scroll_animator =
489 ExistingProgrammaticScrollAnimator()) 489 ExistingProgrammaticScrollAnimator())
490 programmatic_scroll_animator->LayerForCompositedScrollingDidChange( 490 programmatic_scroll_animator->LayerForCompositedScrollingDidChange(
491 timeline); 491 timeline);
492 if (ScrollAnimatorBase* scroll_animator = ExistingScrollAnimator()) 492 if (ScrollAnimatorBase* scroll_animator = ExistingScrollAnimator())
493 scroll_animator->LayerForCompositedScrollingDidChange(timeline); 493 scroll_animator->LayerForCompositedScrollingDidChange(timeline);
494 } 494 }
495 495
496 bool ScrollableArea::ScheduleAnimation() {
497 if (HostWindow* window = GetHostWindow()) {
498 window->ScheduleAnimation(GetFrameViewBase());
499 return true;
500 }
501 return false;
502 }
503
504 void ScrollableArea::ServiceScrollAnimations(double monotonic_time) { 496 void ScrollableArea::ServiceScrollAnimations(double monotonic_time) {
505 bool requires_animation_service = false; 497 bool requires_animation_service = false;
506 if (ScrollAnimatorBase* scroll_animator = ExistingScrollAnimator()) { 498 if (ScrollAnimatorBase* scroll_animator = ExistingScrollAnimator()) {
507 scroll_animator->TickAnimation(monotonic_time); 499 scroll_animator->TickAnimation(monotonic_time);
508 if (scroll_animator->HasAnimationThatRequiresService()) 500 if (scroll_animator->HasAnimationThatRequiresService())
509 requires_animation_service = true; 501 requires_animation_service = true;
510 } 502 }
511 if (ProgrammaticScrollAnimator* programmatic_scroll_animator = 503 if (ProgrammaticScrollAnimator* programmatic_scroll_animator =
512 ExistingProgrammaticScrollAnimator()) { 504 ExistingProgrammaticScrollAnimator()) {
513 programmatic_scroll_animator->TickAnimation(monotonic_time); 505 programmatic_scroll_animator->TickAnimation(monotonic_time);
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
679 offset.y() - ScrollOrigin().Y()); 671 offset.y() - ScrollOrigin().Y());
680 SetScrollOffset(new_offset, kCompositorScroll); 672 SetScrollOffset(new_offset, kCompositorScroll);
681 } 673 }
682 674
683 DEFINE_TRACE(ScrollableArea) { 675 DEFINE_TRACE(ScrollableArea) {
684 visitor->Trace(scroll_animator_); 676 visitor->Trace(scroll_animator_);
685 visitor->Trace(programmatic_scroll_animator_); 677 visitor->Trace(programmatic_scroll_animator_);
686 } 678 }
687 679
688 } // namespace blink 680 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698