Chromium Code Reviews| 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..3e23c54f183fcb8378897c296d506e87d197e6db 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->HasCustomIcon() || app_window->app_icon().IsEmpty()) |
|
msw
2017/04/06 20:23:34
Should HasCustomIcon also check !app_window->app_i
khmel
2017/04/06 20:39:15
Not sure, that means custom icon is set but might
msw
2017/04/06 20:48:22
What you have is fine for now.
|
| + 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->HasCustomIcon() && !app_window->app_icon().IsEmpty()) { |
| + const gfx::Image& app_icon = app_window->app_icon(); |
| + if (!app_icon.IsEmpty()) { |
|
msw
2017/04/06 20:23:34
This check is now redundant with the one on line 1
khmel
2017/04/06 20:39:15
Done.
|
| + owner()->SetLauncherItemImage(shelf_id, app_icon.AsImageSkia()); |
| + item_controller->set_image_set_by_controller(true); |
| + } |
| } |
| } else { |
| owner()->SetShelfItemDelegate(shelf_id, std::move(controller)); |