Commit 7ef2362d authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

Use target shelf y for app list close state animation

When animating app list to closed state, use the current target shelf
y coordinate at target animation bounds. Before this cl, app list was
using ideal shelf bounds, so the animation ends at the visible shelf
bounds, assuming that shelf will remain in visible state, which is the
case when the app list is hidden by clicking home button, but may not
always be true - for example, shelf gets hidden if app list is closed
using esc key.

BUG=1046198

Change-Id: Idb343482432fe9315082b45caff6679177c7d94f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2027172Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736421}
parent d817e6f6
......@@ -1323,7 +1323,7 @@ void AppListControllerImpl::GetNavigableContentsFactory(
int AppListControllerImpl::GetTargetYForAppListHide(aura::Window* root_window) {
DCHECK(Shell::HasInstance());
return Shelf::ForWindow(root_window)->GetIdealBounds().y();
return Shelf::ForWindow(root_window)->GetShelfBoundsInScreen().y();
}
AssistantViewDelegate* AppListControllerImpl::GetAssistantViewDelegate() {
......
......@@ -329,6 +329,10 @@ ShelfVisibilityState Shelf::GetVisibilityState() const {
: SHELF_HIDDEN;
}
gfx::Rect Shelf::GetShelfBoundsInScreen() const {
return shelf_layout_manager_->GetShelfBoundsInScreen();
}
gfx::Rect Shelf::GetIdealBounds() const {
return shelf_layout_manager_->GetIdealBounds();
}
......
......@@ -141,6 +141,8 @@ class ASH_EXPORT Shelf : public ShelfLayoutManagerObserver {
ShelfVisibilityState GetVisibilityState() const;
gfx::Rect GetShelfBoundsInScreen() const;
// Returns the ideal bounds of the shelf assuming it is visible.
gfx::Rect GetIdealBounds() const;
......
......@@ -1071,6 +1071,10 @@ void ShelfLayoutManager::OnDeskSwitchAnimationFinished() {
UpdateVisibilityState();
}
gfx::Rect ShelfLayoutManager::GetShelfBoundsInScreen() const {
return target_bounds_.shelf_bounds;
}
gfx::Rect ShelfLayoutManager::GetNavigationBounds() const {
gfx::Vector2d nav_offset = target_bounds_.shelf_bounds.OffsetFromOrigin();
gfx::Rect nav_bounds = target_bounds_.nav_bounds_in_shelf;
......
......@@ -250,6 +250,7 @@ class ASH_EXPORT ShelfLayoutManager
int CalculateHotseatYInShelf(HotseatState hotseat_target_state) const;
// Getters for bounds and opacity of the various sub-components.
gfx::Rect GetShelfBoundsInScreen() const;
gfx::Rect GetNavigationBounds() const;
gfx::Rect GetHotseatBounds() const;
gfx::Rect GetStatusAreaBounds() const;
......
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