Commit 0c9be3ee authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

app_list: Remove workaround for an issue with focus in Assistant UI

Reverts CL:1903901, which was added as a workaround for an issue where
focusing web contents in Assistant UI would cause app list to revert
back from assistant to "apps" state. The issue was caused by calls to
OnHomeLauncherGainingFocusWithoutAnimation() whose logis was resetting
app list state - this logic has since been removed from the method
(in CL:1966374), which made this workaround unnecessary.

BUG=1026727, b:144056527

TEST=Open embedded Assistant UI, tap "What can you do", verify that
     Assistant UI remains open after tapping grid items (and shows the
     UI associated with the grid item)*
* Unless the grid item is expected to open a browser tab, in which case
the assistant UI is expected to be hidden.

Change-Id: Ibf91647ddceb40dcacf054c66aec6205eac097ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1994121Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#729935}
parent 15f64228
......@@ -550,19 +550,6 @@ void AppListControllerImpl::OnAppListStateChanged(AppListState new_state,
UpdateLauncherContainer();
// Band-aid for https://b/144056527 to update visibility after AppListState
// change. Otherwise, previously calculated visibility in OnVisibilityChanged
// and OnVisibilityWillChange is not correct and makes focus change handler
// code in AppListPresenterImpl::OnWindowFocused close the app list window
// when focus moves into Assistant web contents.
aura::Window* app_list_window = GetWindow();
if (app_list_window) {
const bool app_list_visible = app_list_window->TargetVisibility();
if (app_list_visible != IsVisible()) {
OnVisibilityChanged(app_list_visible, last_visible_display_id_);
}
}
if (new_state == AppListState::kStateEmbeddedAssistant) {
// ShowUi will be no-op if the AssistantUiModel is already visible.
Shell::Get()->assistant_controller()->ui_controller()->ShowUi(
......@@ -1439,7 +1426,7 @@ void AppListControllerImpl::OnVisibilityChanged(bool visible,
// HomeLauncher is only visible when no other app windows are visible,
// unless we are in the process of animating to (or dragging) the home
// launcher.
if (IsTabletMode() && ShouldLauncherShowBehindApps())
if (IsTabletMode())
real_visibility &= !HasVisibleWindows();
aura::Window* app_list_window = GetWindow();
......@@ -1481,8 +1468,7 @@ void AppListControllerImpl::OnVisibilityWillChange(bool visible,
// HomeLauncher is only visible when no other app windows are visible,
// unless we are in the process of animating to (or dragging) the home
// launcher.
if (IsTabletMode() && ShouldLauncherShowBehindApps() &&
home_launcher_transition_state_ ==
if (IsTabletMode() && home_launcher_transition_state_ ==
HomeLauncherTransitionState::kFinished) {
real_target_visibility &= !HasVisibleWindows();
}
......
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