| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "cc/animation/animation_host.h" | 5 #include "cc/animation/animation_host.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "cc/animation/animation_delegate.h" | 10 #include "cc/animation/animation_delegate.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 void NotifyAnimationStarted(base::TimeTicks monotonic_time, | 101 void NotifyAnimationStarted(base::TimeTicks monotonic_time, |
| 102 Animation::TargetProperty target_property, | 102 Animation::TargetProperty target_property, |
| 103 int group) override {} | 103 int group) override {} |
| 104 void NotifyAnimationFinished(base::TimeTicks monotonic_time, | 104 void NotifyAnimationFinished(base::TimeTicks monotonic_time, |
| 105 Animation::TargetProperty target_property, | 105 Animation::TargetProperty target_property, |
| 106 int group) override { | 106 int group) override { |
| 107 DCHECK_EQ(target_property, Animation::SCROLL_OFFSET); | 107 DCHECK_EQ(target_property, Animation::SCROLL_OFFSET); |
| 108 DCHECK(animation_host_->mutator_host_client()); | 108 DCHECK(animation_host_->mutator_host_client()); |
| 109 animation_host_->mutator_host_client()->ScrollOffsetAnimationFinished(); | 109 animation_host_->mutator_host_client()->ScrollOffsetAnimationFinished(); |
| 110 } | 110 } |
| 111 void NotifyAnimationAborted(base::TimeTicks monotonic_time, |
| 112 Animation::TargetProperty target_property, |
| 113 int group) override {} |
| 111 | 114 |
| 112 private: | 115 private: |
| 113 void ReattachScrollOffsetPlayerIfNeeded(int layer_id) { | 116 void ReattachScrollOffsetPlayerIfNeeded(int layer_id) { |
| 114 if (scroll_offset_animation_player_->layer_id() != layer_id) { | 117 if (scroll_offset_animation_player_->layer_id() != layer_id) { |
| 115 if (scroll_offset_animation_player_->layer_id()) | 118 if (scroll_offset_animation_player_->layer_id()) |
| 116 scroll_offset_animation_player_->DetachLayer(); | 119 scroll_offset_animation_player_->DetachLayer(); |
| 117 if (layer_id) | 120 if (layer_id) |
| 118 scroll_offset_animation_player_->AttachLayer(layer_id); | 121 scroll_offset_animation_player_->AttachLayer(layer_id); |
| 119 } | 122 } |
| 120 } | 123 } |
| (...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 569 int layer_id, | 572 int layer_id, |
| 570 const gfx::Vector2dF& scroll_delta, | 573 const gfx::Vector2dF& scroll_delta, |
| 571 const gfx::ScrollOffset& max_scroll_offset, | 574 const gfx::ScrollOffset& max_scroll_offset, |
| 572 base::TimeTicks frame_monotonic_time) { | 575 base::TimeTicks frame_monotonic_time) { |
| 573 DCHECK(scroll_offset_animations_); | 576 DCHECK(scroll_offset_animations_); |
| 574 return scroll_offset_animations_->ScrollAnimationUpdateTarget( | 577 return scroll_offset_animations_->ScrollAnimationUpdateTarget( |
| 575 layer_id, scroll_delta, max_scroll_offset, frame_monotonic_time); | 578 layer_id, scroll_delta, max_scroll_offset, frame_monotonic_time); |
| 576 } | 579 } |
| 577 | 580 |
| 578 } // namespace cc | 581 } // namespace cc |
| OLD | NEW |