Index: chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc |
diff --git a/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc b/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc |
index 669ce2e854d4b97f28dcc820afab9b97372082fe..8a0dd569b14cd3f3b0bf0dc130012a2e36eb9d16 100644 |
--- a/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc |
+++ b/chrome/browser/ui/ash/launcher/extension_app_window_launcher_controller.cc |
@@ -92,6 +92,12 @@ void ExtensionAppWindowLauncherController::OnAppWindowIconChanged( |
AppControllerMap::iterator iter = app_controller_map_.find(app_shelf_id); |
if (iter == app_controller_map_.end()) |
return; |
+ |
+ // Check if the window actually overrides its default icon. Otherwise use app |
+ // icon loader provided by owner. |
+ if (!app_window->window_icon_url().is_valid()) |
msw
2017/04/06 19:22:29
Should this also bail if app_window->app_icon().Is
khmel
2017/04/06 20:10:40
makes sense, thanks
|
+ return; |
+ |
ExtensionAppWindowLauncherItemController* controller = iter->second; |
controller->set_image_set_by_controller(true); |
owner()->SetLauncherItemImage(controller->shelf_id(), |
@@ -182,10 +188,12 @@ void ExtensionAppWindowLauncherController::RegisterApp(AppWindow* app_window) { |
if (shelf_id == 0) { |
shelf_id = owner()->CreateAppLauncherItem(std::move(controller), status); |
// Restore any existing app icon and flag as set. |
- const gfx::Image& app_icon = app_window->app_icon(); |
- if (!app_icon.IsEmpty()) { |
- owner()->SetLauncherItemImage(shelf_id, app_icon.AsImageSkia()); |
- item_controller->set_image_set_by_controller(true); |
+ if (app_window->window_icon_url().is_valid()) { |
+ const gfx::Image& app_icon = app_window->app_icon(); |
+ if (!app_icon.IsEmpty()) { |
+ owner()->SetLauncherItemImage(shelf_id, app_icon.AsImageSkia()); |
+ item_controller->set_image_set_by_controller(true); |
+ } |
} |
} else { |
owner()->SetShelfItemDelegate(shelf_id, std::move(controller)); |