Chromium Code Reviews| 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/element_animations.h" | 5 #include "cc/animation/element_animations.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 366 bool was_active = is_active_; | 366 bool was_active = is_active_; |
| 367 is_active_ = false; | 367 is_active_ = false; |
| 368 | 368 |
| 369 for (auto& player : players_list_) { | 369 for (auto& player : players_list_) { |
| 370 if (player.HasNonDeletedAnimation()) { | 370 if (player.HasNonDeletedAnimation()) { |
| 371 is_active_ = true; | 371 is_active_ = true; |
| 372 break; | 372 break; |
| 373 } | 373 } |
| 374 } | 374 } |
| 375 | 375 |
| 376 if (is_active_ && (!was_active || force)) { | 376 if (is_active_ && (!was_active || force) && has_element_in_any_list()) { |
|
loyso (OOO)
2016/11/28 04:27:04
Sohuldn't it be simple with a semantics similar to
junchao.han
2016/11/28 07:27:45
for 2 unit tests failed in patch set 3, UpdateActi
| |
| 377 animation_host_->DidActivateElementAnimations(this); | 377 animation_host_->DidActivateElementAnimations(this); |
| 378 } else if (!is_active_ && (was_active || force)) { | 378 } else if (!is_active_ && (was_active || force)) { |
| 379 // Resetting last_tick_time_ here ensures that calling ::UpdateState | 379 // Resetting last_tick_time_ here ensures that calling ::UpdateState |
| 380 // before ::Animate doesn't start an animation. | 380 // before ::Animate doesn't start an animation. |
| 381 last_tick_time_ = base::TimeTicks(); | 381 last_tick_time_ = base::TimeTicks(); |
| 382 animation_host_->DidDeactivateElementAnimations(this); | 382 animation_host_->DidDeactivateElementAnimations(this); |
| 383 } | 383 } |
| 384 } | 384 } |
| 385 } | 385 } |
| 386 | 386 |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 566 if (animation_host()) { | 566 if (animation_host()) { |
| 567 DCHECK(animation_host()->mutator_host_client()); | 567 DCHECK(animation_host()->mutator_host_client()); |
| 568 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( | 568 return animation_host()->mutator_host_client()->GetScrollOffsetForAnimation( |
| 569 element_id()); | 569 element_id()); |
| 570 } | 570 } |
| 571 | 571 |
| 572 return gfx::ScrollOffset(); | 572 return gfx::ScrollOffset(); |
| 573 } | 573 } |
| 574 | 574 |
| 575 } // namespace cc | 575 } // namespace cc |
| OLD | NEW |