Commit e7ded6a1 authored by khmel's avatar khmel Committed by Commit Bot

Fix missing default app icons in launcher.

Setting app launcher icon is multi-step process. At first step we set
default (or pre-loaded icon) and then try to fetch, decode and load
actual icon. For some app fetch/decode step may be skipped. At this case
icon is left what was set at first step. With recent refactoring, app
launcher icon and chrome app icon were split and synced via updater.
App launcher item is created after Chrome app item. Some attributes from
Chrome app are passed via metadata but not the icon.
This CL sets the icon from Chrome app item to app laucnher item at the
moment of creation app launcher item.

Bug: 809269
Test: Manually
Change-Id: Iee8f5701d41f2ea19533d7df3edcc3898d606044
Reviewed-on: https://chromium-review.googlesource.com/902610Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Yury Khmel <khmel@google.com>
Cr-Commit-Position: refs/heads/master@{#534701}
parent 9f4fb5af
...@@ -436,5 +436,10 @@ ChromeAppListModelUpdater::CreateAppListItem( ...@@ -436,5 +436,10 @@ ChromeAppListModelUpdater::CreateAppListItem(
std::unique_ptr<app_list::AppListItem> ash_app_list_item = std::unique_ptr<app_list::AppListItem> ash_app_list_item =
std::make_unique<app_list::AppListItem>(metadata->id); std::make_unique<app_list::AppListItem>(metadata->id);
ash_app_list_item->SetMetadata(std::move(metadata)); ash_app_list_item->SetMetadata(std::move(metadata));
ChromeAppListItem* chrome_app_item = FindItem(ash_app_list_item->id());
if (chrome_app_item && !chrome_app_item->icon().isNull())
ash_app_list_item->SetIcon(chrome_app_item->icon());
return ash_app_list_item; return ash_app_list_item;
} }
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