Commit af916721 authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

Start home fade in from overview sooner

Makes home scale and fade in animation run in parallel with overview
fadeout (instead of waiting for the overview animation to end).

Change-Id: Ica9bd3cc98faf5dd2827fe6871a1f4b7b5d7c953
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1918664Reviewed-by: default avatarXiaoqian Dai <xdai@chromium.org>
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#715826}
parent 1389e46e
...@@ -267,19 +267,38 @@ void HomeScreenController::OnOverviewModeStarting() { ...@@ -267,19 +267,38 @@ void HomeScreenController::OnOverviewModeStarting() {
void HomeScreenController::OnOverviewModeEnding( void HomeScreenController::OnOverviewModeEnding(
OverviewSession* overview_session) { OverviewSession* overview_session) {
// The launcher should be shown after overview mode finishes animating, in // The launcher will be shown after overview mode finishes animating, in
// OnOverviewModeEndingAnimationComplete(). Overview however is nullptr by the // OnOverviewModeEndingAnimationComplete(). Overview however is nullptr by
// time the animations are finished, so cache the exit type here. // the time the animations are finished, so cache the exit type here.
overview_exit_type_ = overview_exit_type_ =
base::make_optional(overview_session->enter_exit_overview_type()); base::make_optional(overview_session->enter_exit_overview_type());
// If the overview is fading out, start the home screen animation in parallel.
// Otherwise the transition will be initiated in
// OnOverviewModeEndingAnimationComplete().
if (overview_session->enter_exit_overview_type() ==
OverviewSession::EnterExitOverviewType::kFadeOutExit) {
home_screen_presenter_.ScheduleOverviewModeAnimation(
HomeScreenPresenter::TransitionType::kScaleHomeIn, true /*animate*/);
// Make sure the window visibility is updated, in case it was previously
// hidden due to overview being shown.
UpdateVisibility();
}
} }
void HomeScreenController::OnOverviewModeEndingAnimationComplete( void HomeScreenController::OnOverviewModeEndingAnimationComplete(
bool canceled) { bool canceled) {
if (canceled)
return;
DCHECK(overview_exit_type_.has_value()); DCHECK(overview_exit_type_.has_value());
// For kFadeOutExit EnterExitOverviewType, the home animation is scheduled in
// OnOverviewModeEnding(), so there is nothing else to do at this point.
if (canceled || *overview_exit_type_ ==
OverviewSession::EnterExitOverviewType::kFadeOutExit) {
overview_exit_type_ = base::nullopt;
return;
}
const bool animate = const bool animate =
*overview_exit_type_ == *overview_exit_type_ ==
OverviewSession::EnterExitOverviewType::kSlideOutExit || OverviewSession::EnterExitOverviewType::kSlideOutExit ||
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment