| Index: chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc
|
| diff --git a/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc b/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc
|
| index 41d5953e1cda765dc682a8263440d1ea3a7683d6..89489f620dedb97f7ec9d4acae03fac4a5dbd1cb 100644
|
| --- a/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc
|
| +++ b/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.cc
|
| @@ -17,8 +17,11 @@
|
| #include "ui/wm/core/window_animations.h"
|
|
|
| AppWindowLauncherItemController::AppWindowLauncherItemController(
|
| - const ash::ShelfID& shelf_id)
|
| - : ash::ShelfItemDelegate(shelf_id), observed_windows_(this) {}
|
| + const ash::ShelfID& shelf_id,
|
| + ChromeLauncherController* owner)
|
| + : ash::ShelfItemDelegate(shelf_id),
|
| + owner_(owner),
|
| + observed_windows_(this) {}
|
|
|
| AppWindowLauncherItemController::~AppWindowLauncherItemController() {}
|
|
|
| @@ -143,6 +146,8 @@ void AppWindowLauncherItemController::OnWindowPropertyChanged(
|
| status = ash::STATUS_RUNNING;
|
| }
|
| ChromeLauncherController::instance()->SetItemStatus(shelf_id(), status);
|
| + } else if (key == aura::client::kAppIconKey) {
|
| + UpdateLauncherItem();
|
| }
|
| }
|
|
|
| @@ -174,3 +179,19 @@ AppWindowLauncherItemController::ActivateOrAdvanceToNextAppWindow(
|
| }
|
| return ash::SHELF_ACTION_NONE;
|
| }
|
| +
|
| +void AppWindowLauncherItemController::UpdateLauncherItem() {
|
| + const gfx::ImageSkia* app_icon = nullptr;
|
| + ui::BaseWindow* last_active_window = GetLastActiveWindow();
|
| + if (last_active_window && last_active_window->GetNativeWindow()) {
|
| + app_icon = last_active_window->GetNativeWindow()->GetProperty(
|
| + aura::client::kAppIconKey);
|
| + }
|
| + if (app_icon && !app_icon->isNull()) {
|
| + set_image_set_by_controller(true);
|
| + owner()->SetLauncherItemImage(shelf_id(), *app_icon);
|
| + } else if (image_set_by_controller()) {
|
| + set_image_set_by_controller(false);
|
| + owner()->UpdateAppItemImage(shelf_id().app_id);
|
| + }
|
| +}
|
|
|