Commit 8c8efb1a authored by nancy's avatar nancy Committed by Commit Bot

Fix the Crostini penguin icon not shown on Shelf for unrecognised apps.

The reason is CL:2006847 adds the checking whether the app exists in
AppService. However, unrecognised Crostini apps should still load icons
using AppServiceProxy, though they doesn't exist in AppService. So
update the checking condition, and special handle the unrecognised Crostini
apps, similar with the icon loading function.

BUG=1047036

Change-Id: I80a3ae3704a9cc6e2e57df1fef53867aa731552a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2029470
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#737014}
parent 6f9e76be
...@@ -33,17 +33,23 @@ AppServiceAppIconLoader::~AppServiceAppIconLoader() = default; ...@@ -33,17 +33,23 @@ AppServiceAppIconLoader::~AppServiceAppIconLoader() = default;
bool AppServiceAppIconLoader::CanLoadImageForApp(const std::string& app_id) { bool AppServiceAppIconLoader::CanLoadImageForApp(const std::string& app_id) {
// Skip the ARC intent helper, the system Android app that proxies links to // Skip the ARC intent helper, the system Android app that proxies links to
// Chrome, which should be hidden. // Chrome, which should be hidden.
if (app_id == kArcIntentHelperAppId) if (app_id == kArcIntentHelperAppId) {
return false; return false;
}
apps::AppServiceProxy* proxy = apps::AppServiceProxy* proxy =
apps::AppServiceProxyFactory::GetForProfile(profile()); apps::AppServiceProxyFactory::GetForProfile(profile());
if (!proxy || proxy->AppRegistryCache().GetAppType(app_id) ==
apps::mojom::AppType::kUnknown) { // Support icon loading for apps registered in AppService or Crostini apps
return false; // with the prefix "crostini:".
if (proxy && (proxy->AppRegistryCache().GetAppType(app_id) !=
apps::mojom::AppType::kUnknown ||
base::StartsWith(app_id, crostini::kCrostiniAppIdPrefix,
base::CompareCase::SENSITIVE))) {
return true;
} }
return true; return false;
} }
void AppServiceAppIconLoader::FetchImage(const std::string& app_id) { void AppServiceAppIconLoader::FetchImage(const std::string& app_id) {
......
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