Chromium Code Reviews| Index: chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h |
| diff --git a/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h b/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h |
| index e1fd8767a114e4be4af3debd6ca8c8b24f7e9e4c..456207801be8e255e3a75a852c09f1e22be35ddf 100644 |
| --- a/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h |
| +++ b/chrome/browser/ui/ash/launcher/app_window_launcher_item_controller.h |
| @@ -13,6 +13,8 @@ |
| #include "base/scoped_observer.h" |
| #include "ui/aura/window_observer.h" |
| +class ChromeLauncherController; |
| + |
| namespace aura { |
| class Window; |
| } |
| @@ -60,15 +62,11 @@ class AppWindowLauncherItemController : public ash::ShelfItemDelegate, |
| // Activates the window at position |index|. |
| void ActivateIndexedApp(size_t index); |
| - // Called when launcher item may need to be updated, eg. label or icon. |
| - // TODO(khmel): Use aura::Window property and observe property change |
| - // http://crbug.com/724292 |
| - virtual void UpdateLauncherItem() {} |
| - |
| const WindowList& windows() const { return windows_; } |
| protected: |
| - explicit AppWindowLauncherItemController(const ash::ShelfID& shelf_id); |
| + AppWindowLauncherItemController(const ash::ShelfID& shelf_id, |
| + ChromeLauncherController* owner); |
|
msw
2017/06/01 19:47:28
nit: just use ChromeLauncherController::instance()
khmel
2017/06/01 21:55:46
Good point
|
| // Returns the action performed. Should be one of SHELF_ACTION_NONE, |
| // SHELF_ACTION_WINDOW_ACTIVATED, or SHELF_ACTION_WINDOW_MINIMIZED. |
| @@ -84,9 +82,18 @@ class AppWindowLauncherItemController : public ash::ShelfItemDelegate, |
| // Returns last active window in the controller or first window. |
| ui::BaseWindow* GetLastActiveWindow(); |
| + ChromeLauncherController* owner() { return owner_; } |
| + |
| private: |
| WindowList::iterator GetFromNativeWindow(aura::Window* window); |
| + // Handles the case when the app window in this controller has been changed, |
| + // and sets the new controller icon based on currently active window. |
|
msw
2017/06/01 19:47:28
nit: "the currently"
khmel
2017/06/01 21:55:46
Done.
|
| + void UpdateShelfItemIcon(); |
| + |
| + // Unowned pointer. |
| + ChromeLauncherController* const owner_; |
| + |
| // List of associated app windows |
| WindowList windows_; |