Commit 1c708ef7 authored by Toni Barzic's avatar Toni Barzic Committed by Commit Bot

Better handle session start in AppListControllerImpl

A folow-up on CL:1988989 with a couple of things I realized can be done
better:
*   use presenter_.GetTargetVisibility() to check if app list has been
    previously shown
*   Show app list in tablet mode using HomeScreenController::Show (it
    handles some additional tablet mode specific things - e.g. sets the
    show source)
*   Use last_target_visible_ to check if app list should be visible when
    session changes to active (instead of trying to recalculate target
    visibility state again)

BUG=1038512

Change-Id: I6a1aa7613935ed042a45b4aa622bd7cf2203a071
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1992242Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Commit-Queue: Toni Baržić <tbarzic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#729962}
parent 8e7fabcd
...@@ -511,15 +511,12 @@ void AppListControllerImpl::OnSessionStateChanged( ...@@ -511,15 +511,12 @@ void AppListControllerImpl::OnSessionStateChanged(
// Show the app list after signing in in tablet mode. For metrics, the app // Show the app list after signing in in tablet mode. For metrics, the app
// list is not considered shown since the browser window is shown over app // list is not considered shown since the browser window is shown over app
// list upon login. // list upon login.
if (!presenter_.GetView()) { if (!presenter_.GetTargetVisibility())
Show(GetDisplayIdToShowAppListOn(), Shell::Get()->home_screen_controller()->Show();
base::nullopt /* no AppListShowSource */, base::TimeTicks());
}
// Hide app list UI initially to prevent app list from flashing in background // Hide app list UI initially to prevent app list from flashing in background
// while the initial app window is being shown. // while the initial app window is being shown.
if (HasVisibleWindows() || if (!last_target_visible_) {
Shell::Get()->overview_controller()->InOverviewSession()) {
presenter_.GetView()->SetVisible(false); presenter_.GetView()->SetVisible(false);
presenter_.GetView()->search_box_view()->SetVisible(false); presenter_.GetView()->search_box_view()->SetVisible(false);
} else { } else {
......
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