Commit 3a0d1535 authored by Jun Mukai's avatar Jun Mukai Committed by Commit Bot

Fix the visibility of embedded assistant UI in tablet mode.

As commented in the code, page_view->RequestFocus() might cause
ResetForShow(), which hides the embedded asssitant view, thus
the assistant UI might go invisible in a weird situation.

I hope I could find a holistic solution of controlling states
within ContentsView, but so far this would be the simplest fix
for the problem.

Bug: b/140831868
Test: manually
Change-Id: I9e1b551c2db448ff40c9f978130ce2a0225a4ebb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1803958
Commit-Queue: Jun Mukai <mukai@chromium.org>
Reviewed-by: default avatarTao Wu <wutao@chromium.org>
Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696597}
parent 51a61da4
...@@ -317,8 +317,14 @@ void ContentsView::ShowEmbeddedAssistantUI(bool show) { ...@@ -317,8 +317,14 @@ void ContentsView::ShowEmbeddedAssistantUI(bool show) {
// Hide or Show results. // Hide or Show results.
auto* page_view = GetPageView(assistant_page); auto* page_view = GetPageView(assistant_page);
page_view->SetVisible(show); page_view->SetVisible(show);
if (show) if (show) {
page_view->RequestFocus(); page_view->RequestFocus();
// RequestFocus() might cause ResetForShow() method through
// AppListView::OnHomeLauncherGainingFocusWithoutAnimation() and it can hide
// |page_view|. Thus |page_view|'s visibility should be set again. See
// b/140831868.
page_view->SetVisible(show);
}
const int search_results_page = const int search_results_page =
GetPageIndexForState(ash::AppListState::kStateSearchResults); GetPageIndexForState(ash::AppListState::kStateSearchResults);
......
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