Commit 421ca8e4 authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

cros: Shelf should hide after launcher animation.

The shelf bg used to shift opacity as the launcher animation began,
instead it should wait until the launcher is at shelf height.

This changes two things:
 - Notify observers of target visibility changing when the animation begins.
 - Notify observers of actual visibility changing when the animation ends.

Change-Id: I6e020406bb6fc0daf3430cec38c0abb6fb230a97
Reviewed-on: https://chromium-review.googlesource.com/c/1370368Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#622041}
parent 6c755cc0
...@@ -101,7 +101,6 @@ AppListPresenterImpl::AppListPresenterImpl( ...@@ -101,7 +101,6 @@ AppListPresenterImpl::AppListPresenterImpl(
AppListPresenterImpl::~AppListPresenterImpl() { AppListPresenterImpl::~AppListPresenterImpl() {
Dismiss(base::TimeTicks()); Dismiss(base::TimeTicks());
delegate_.reset();
// Ensures app list view goes before the controller since pagination model // Ensures app list view goes before the controller since pagination model
// lives in the controller and app list view would access it on destruction. // lives in the controller and app list view would access it on destruction.
if (view_) { if (view_) {
...@@ -169,7 +168,6 @@ void AppListPresenterImpl::Dismiss(base::TimeTicks event_time_stamp) { ...@@ -169,7 +168,6 @@ void AppListPresenterImpl::Dismiss(base::TimeTicks event_time_stamp) {
delegate_->OnClosing(); delegate_->OnClosing();
ScheduleAnimation(); ScheduleAnimation();
NotifyTargetVisibilityChanged(GetTargetVisibility()); NotifyTargetVisibilityChanged(GetTargetVisibility());
NotifyVisibilityChanged(GetTargetVisibility(), display_id);
base::RecordAction(base::UserMetricsAction("Launcher_Dismiss")); base::RecordAction(base::UserMetricsAction("Launcher_Dismiss"));
} }
...@@ -390,6 +388,8 @@ void AppListPresenterImpl::OnWindowFocused(aura::Window* gained_focus, ...@@ -390,6 +388,8 @@ void AppListPresenterImpl::OnWindowFocused(aura::Window* gained_focus,
// AppListPresenterImpl, ui::ImplicitAnimationObserver implementation: // AppListPresenterImpl, ui::ImplicitAnimationObserver implementation:
void AppListPresenterImpl::OnImplicitAnimationsCompleted() { void AppListPresenterImpl::OnImplicitAnimationsCompleted() {
NotifyVisibilityChanged(GetTargetVisibility(), GetDisplayId());
if (is_visible_) { if (is_visible_) {
view_->GetWidget()->Activate(); view_->GetWidget()->Activate();
} else { } else {
......
...@@ -22,5 +22,5 @@ IN_PROC_BROWSER_TEST_F(AppListClientInteractiveTest, ShowAndDismiss) { ...@@ -22,5 +22,5 @@ IN_PROC_BROWSER_TEST_F(AppListClientInteractiveTest, ShowAndDismiss) {
ASSERT_TRUE(client->app_list_visible()); ASSERT_TRUE(client->app_list_visible());
client->DismissView(); client->DismissView();
client->FlushMojoForTesting(); client->FlushMojoForTesting();
ASSERT_FALSE(client->app_list_visible()); ASSERT_FALSE(client->app_list_target_visibility());
} }
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