Commit cc2b749d authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

CrOs: Reset the searchbox when the AppListView is closed

Because the launcher is cached, ensure the search box is reset when the
close animation is complete.

TEST=automated

Bug: 969648
Change-Id: I9ae97cc523a1db59ab68c334a065f833d2b6ee4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1656458
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Auto-Submit: Alex Newcomer <newcomer@chromium.org>
Reviewed-by: default avatarSammie Quon <sammiequon@chromium.org>
Cr-Commit-Position: refs/heads/master@{#668581}
parent ea00b56e
......@@ -278,6 +278,23 @@ TEST_F(AppListPresenterDelegateZeroStateTest, RightClickSearchBoxInPeeking) {
EXPECT_EQ(AppListViewState::kPeeking, app_list_view->app_list_state());
}
TEST_F(AppListPresenterDelegateZeroStateTest,
ReshownAppListResetsSearchBoxActivation) {
// Activate the search box.
GetAppListTestHelper()->ShowAndRunLoop(GetPrimaryDisplayId());
GetEventGenerator()->GestureTapAt(GetPointInsideSearchbox());
// Dismiss and re-show the AppList.
GetAppListTestHelper()->Dismiss();
GetAppListTestHelper()->ShowAndRunLoop(GetPrimaryDisplayId());
// Test that the search box is no longer active.
EXPECT_FALSE(GetAppListTestHelper()
->GetAppListView()
->search_box_view()
->is_search_box_active());
}
// Verifies that tapping on the search box in tablet mode with animation and
// zero state enabled should not bring Chrome crash (https://crbug.com/958267).
TEST_F(AppListPresenterDelegateZeroStateTest, ClickSearchBoxInTabletMode) {
......
......@@ -1898,12 +1898,16 @@ void AppListView::OnBoundsAnimationCompleted() {
const bool was_animation_interrupted =
GetRemainingBoundsAnimationDistance() != 0;
// Close embedded Assistant UI if it is open, to reset the
// |assistant_page_view| bounds and AppListState.
if (app_list_state_ == ash::AppListViewState::kClosed) {
// Close embedded Assistant UI if it is open, to reset the
// |assistant_page_view| bounds and AppListState.
auto* contents_view = app_list_main_view()->contents_view();
if (contents_view->IsShowingEmbeddedAssistantUI())
contents_view->ShowEmbeddedAssistantUI(false);
// Reset the search box to be shown again. This is done after the animation
// is complete in order to minimize work during the animation.
search_box_view_->SetSearchBoxActive(false /*active*/, ui::ET_LAST);
}
// Layout if the animation was completed.
......
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