Commit d1429d18 authored by Scott Violet's avatar Scott Violet Committed by Commit Bot

chromeos: make app-list not layout search-box when closed

As part of https://chromium-review.googlesource.com/c/chromium/src/+/1547051
InvalidateLayout() was changed to result in a Layout() at a later date. This
means there may be an additional Layout() called. In particular, the app-list
now attempts to layout the search-box when closed, which triggers the search-box
to go off screen. The fix is to not layout the search box if closed.

BUG=949368
TEST=see bug

Change-Id: I810ba64a0d44cfedb4f1746697c78b74a303526d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1559887Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#649271}
parent 374a30b9
...@@ -295,6 +295,11 @@ bool ContentsView::IsShowingEmbeddedAssistantUI() const { ...@@ -295,6 +295,11 @@ bool ContentsView::IsShowingEmbeddedAssistantUI() const {
} }
void ContentsView::UpdatePageBounds() { void ContentsView::UpdatePageBounds() {
// No need to do anything while closed. To layout while closed may result in
// the search-box going offscreen.
if (app_list_view_->app_list_state() == AppListViewState::CLOSED)
return;
// The bounds calculations will potentially be mid-transition (depending on // The bounds calculations will potentially be mid-transition (depending on
// the state of the PaginationModel). // the state of the PaginationModel).
int current_page = std::max(0, pagination_model_.selected_page()); int current_page = std::max(0, pagination_model_.selected_page());
...@@ -326,7 +331,6 @@ void ContentsView::UpdatePageBounds() { ...@@ -326,7 +331,6 @@ void ContentsView::UpdatePageBounds() {
page->OnAnimationUpdated(progress, current_state, target_state); page->OnAnimationUpdated(progress, current_state, target_state);
} }
// Update the search box.
UpdateSearchBox(progress, current_state, target_state); UpdateSearchBox(progress, current_state, target_state);
// Update the expand arrow view's opacity. // Update the expand arrow view's opacity.
......
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