Skip to content

Commit

Permalink
desks: Ensure OnDeskSwitchAnimation Launching/Finished are paired up.
Browse files Browse the repository at this point in the history
Moves Finished to the destructor so it is always paired up with a
Launching. Shelf relies on the two being paired up so it is hidden and
shown properly.

It's possible to modify Replace to have more return codes and handle the
case a screenshot is not yet taken more gracefully. However, if a new
use of Replace is added the user will have to ensure a new animation is
not created on top of an existing one.

Bug: 1166475
Test: manual
Change-Id: I9d1ca10d4a028ee881af821ee4063ed2576c3b35
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2633069
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Commit-Queue: Sammie Quon <sammiequon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#844245}
  • Loading branch information
Sammie Quon authored and Chromium LUCI CQ committed Jan 15, 2021
1 parent 225541f commit ee81757
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ash/wm/desks/desk_animation_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ DeskAnimationBase::DeskAnimationBase(DesksController* controller,
DCHECK_GE(ending_desk_index_, 0);
}

DeskAnimationBase::~DeskAnimationBase() = default;
DeskAnimationBase::~DeskAnimationBase() {
for (auto& observer : controller_->observers_)
observer.OnDeskSwitchAnimationFinished();
}

void DeskAnimationBase::Launch() {
for (auto& observer : controller_->observers_)
Expand Down Expand Up @@ -128,9 +131,6 @@ void DeskAnimationBase::OnDeskSwitchAnimationFinished() {

throughput_tracker_.Stop();

for (auto& observer : controller_->observers_)
observer.OnDeskSwitchAnimationFinished();

if (skip_notify_controller_on_animation_finished_for_testing_)
return;

Expand Down

0 comments on commit ee81757

Please sign in to comment.