Commit 61fa9d45 authored by Timothy Loh's avatar Timothy Loh Committed by Commit Bot

Dismiss the app launcher when launching a Crostini app

As it may take several seconds for the Crostini container to spin up,
dismiss the app launcher so there is some sort of user feedback when
tapping an app. Eventually we should show a spinner or something.

Change-Id: I62bda8b7a673bbdf10d6d6b85003a1516df00b8b
Reviewed-on: https://chromium-review.googlesource.com/1032352Reviewed-by: default avatarNicholas Verne <nverne@chromium.org>
Commit-Queue: Nicholas Verne <nverne@chromium.org>
Cr-Commit-Position: refs/heads/master@{#554630}
parent a564cbb5
...@@ -47,8 +47,14 @@ const char* CrostiniAppItem::GetItemType() const { ...@@ -47,8 +47,14 @@ const char* CrostiniAppItem::GetItemType() const {
void CrostiniAppItem::Activate(int event_flags) { void CrostiniAppItem::Activate(int event_flags) {
LaunchCrostiniApp(profile(), id()); LaunchCrostiniApp(profile(), id());
// TODO(timloh): Detect and do something if launching failed, as otherwise
// the app launcher remains open and there's no feedback. // TODO(timloh): Launching Crostini apps can take a few seconds if the
// container is not currently running. Hiding the launcher at least provides
// the user some feedback that they actually clicked an icon. We should make
// this better, e.g. by showing some sort of spinner. We also need to handle
// failures to start the container or app, as those are currently ignored.
if (!GetController()->IsHomeLauncherEnabledInTabletMode())
GetController()->DismissView();
} }
void CrostiniAppItem::GetContextMenuModel(GetMenuModelCallback callback) { void CrostiniAppItem::GetContextMenuModel(GetMenuModelCallback callback) {
......
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