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 "ash/rotator/screen_rotation_animator.h" | 5 #include "ash/rotator/screen_rotation_animator.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 414 for (auto& observer : screen_rotation_animator_observers_) | 414 for (auto& observer : screen_rotation_animator_observers_) |
| 415 observer.OnScreenRotationAnimationFinished(this); | 415 observer.OnScreenRotationAnimationFinished(this); |
| 416 } | 416 } |
| 417 | 417 |
| 418 void ScreenRotationAnimator::set_disable_animation_timers_for_test( | 418 void ScreenRotationAnimator::set_disable_animation_timers_for_test( |
| 419 bool disable_timers) { | 419 bool disable_timers) { |
| 420 disable_animation_timers_for_test_ = disable_timers; | 420 disable_animation_timers_for_test_ = disable_timers; |
| 421 } | 421 } |
| 422 | 422 |
| 423 void ScreenRotationAnimator::StopAnimating() { | 423 void ScreenRotationAnimator::StopAnimating() { |
| 424 // |old_layer_tree_owner_| could be nullptr if another rotation request comes | |
| 425 // before the copy request finishes. At this time there is no animation. | |
| 426 if (!old_layer_tree_owner_) | |
|
oshima
2017/04/10 18:38:46
what's the exact call sequence that reaches this c
wutao
2017/04/10 21:19:22
Add the enum state, please review.
Current sequen
| |
| 427 return; | |
| 428 | |
| 424 aura::Window* root_window = GetRootWindow(display_id_); | 429 aura::Window* root_window = GetRootWindow(display_id_); |
| 425 for (ui::Layer* child_layer : root_window->layer()->children()) { | 430 for (ui::Layer* child_layer : root_window->layer()->children()) { |
| 426 if (child_layer == old_layer_tree_owner_->root()) | 431 if (child_layer == old_layer_tree_owner_->root()) |
| 427 continue; | 432 continue; |
| 428 | 433 |
| 429 child_layer->GetAnimator()->StopAnimating(); | 434 child_layer->GetAnimator()->StopAnimating(); |
| 430 } | 435 } |
| 431 | 436 |
| 432 old_layer_tree_owner_->root()->GetAnimator()->StopAnimating(); | 437 old_layer_tree_owner_->root()->GetAnimator()->StopAnimating(); |
| 433 } | 438 } |
| 434 | 439 |
| 435 } // namespace ash | 440 } // namespace ash |
| OLD | NEW |