Commit b6631bfb authored by nancy's avatar nancy Committed by Commit Bot

Fix the Crostini new Terminal web app crash issue.

The Crostini new terminal app is a system web app, although the app type
in AppService is still Crostini. So update IsOpenedInBrowser to return
true for the new terminal app id kCrostiniTerminalSystemAppId, so that
AppServiceAppWindowLauncherController can skip that, and leave it to
BrowserStatusMonitor to handle all windows related requests.

BUG=1048906

Change-Id: Ie06f0616cf3a3ff6f25d2ad878151c8f71c98e84
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2038930Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#739102}
parent e0c63157
......@@ -11,6 +11,7 @@
#include "base/time/time.h"
#include "chrome/browser/apps/app_service/app_service_proxy.h"
#include "chrome/browser/apps/app_service/app_service_proxy_factory.h"
#include "chrome/browser/chromeos/crostini/crostini_util.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/ui/ash/launcher/app_service/app_service_app_window_launcher_controller.h"
......@@ -305,6 +306,11 @@ apps::InstanceState AppServiceInstanceRegistryHelper::CalculateActivatedState(
bool AppServiceInstanceRegistryHelper::IsOpenedInBrowser(
const std::string& app_id,
aura::Window* window) const {
// Crostini Terminal App with the app_id kCrostiniTerminalSystemAppId is a
// System Web App.
if (app_id == crostini::kCrostiniTerminalSystemAppId)
return true;
apps::mojom::AppType app_type = proxy_->AppRegistryCache().GetAppType(app_id);
if (app_type != apps::mojom::AppType::kExtension &&
app_type != apps::mojom::AppType::kWeb) {
......
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