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 5d54fda37c92e46bddc576560fffc30a1f824d73..77d55e8f772767ba34951b33601b2869780f25c0 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 |
| @@ -5,8 +5,6 @@ |
| #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ |
| #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ |
| -#include <stddef.h> |
| - |
| #include <list> |
| #include <string> |
| @@ -19,32 +17,26 @@ namespace aura { |
| class Window; |
| } |
| -namespace extensions { |
| -class AppWindow; |
| +namespace ui { |
| +class BaseWindow; |
| } |
| class ChromeLauncherController; |
| -// This is a LauncherItemController for app windows. There is one instance per |
| -// app, per launcher id. For apps with multiple windows, each item controller |
| -// keeps track of all windows associated with the app and their activation |
| -// order. Instances are owned by ash::ShelfItemDelegateManager. |
| +// This is a LauncherItemController for abstract app windows. There is one |
| +// instance per app, per launcher id. For apps with multiple windows, each item |
| +// controller keeps track of all windows associated with the app and their |
| +// activation order. Instances are owned by ash::ShelfItemDelegateManager. |
| // |
| // Tests are in chrome_launcher_controller_browsertest.cc |
| class AppWindowLauncherItemController : public LauncherItemController, |
| public aura::WindowObserver { |
| public: |
| - AppWindowLauncherItemController(Type type, |
| - const std::string& app_shelf_id, |
| - const std::string& app_id, |
| - ChromeLauncherController* controller); |
| - |
| ~AppWindowLauncherItemController() override; |
| - void AddAppWindow(extensions::AppWindow* app_window, |
| - ash::ShelfItemStatus status); |
| + void AddWindow(ui::BaseWindow* window); |
| - void RemoveAppWindowForWindow(aura::Window* window); |
| + void RemoveWindowForNativeWindow(aura::Window* window); |
| void SetActiveWindow(aura::Window* window); |
| @@ -72,31 +64,42 @@ class AppWindowLauncherItemController : public LauncherItemController, |
| intptr_t old) override; |
| // Get the number of running applications/incarnations of this. |
| - size_t app_window_count() const { return app_windows_.size(); } |
| + size_t window_count() const { return windows_.size(); } |
| // Activates the window at position |index|. |
| void ActivateIndexedApp(size_t index); |
| - private: |
| - typedef std::list<extensions::AppWindow*> AppWindowList; |
| + protected: |
| + typedef std::list<ui::BaseWindow*> WindowList; |
|
xiyuan
2016/03/23 23:22:53
nit: using WindowList = std::list<ui::BaseWindow*>
khmel
2016/03/24 16:30:37
Done.
|
| + |
| + AppWindowLauncherItemController(Type type, |
| + const std::string& app_shelf_id, |
| + const std::string& app_id, |
| + ChromeLauncherController* controller); |
| + |
| + // Called when app window is removed from controller. |
| + virtual void OnWindowRemoved(ui::BaseWindow* window) {} |
| // Returns the action performed. Should be one of kNoAction, |
| // kExistingWindowActivated, or kExistingWindowMinimized. |
| ash::ShelfItemDelegate::PerformedAction ShowAndActivateOrMinimize( |
| - extensions::AppWindow* app_window); |
| + ui::BaseWindow* window); |
| // Activate the given |window_to_show|, or - if already selected - advance to |
| // the next window of similar type. |
| // Returns the action performed. Should be one of kNoAction, |
| // kExistingWindowActivated, or kExistingWindowMinimized. |
| ash::ShelfItemDelegate::PerformedAction ActivateOrAdvanceToNextAppWindow( |
| - extensions::AppWindow* window_to_show); |
| + ui::BaseWindow* window_to_show); |
| + |
| + const WindowList& windows() { return windows_; } |
| + private: |
| // List of associated app windows |
| - AppWindowList app_windows_; |
| + WindowList windows_; |
| // Pointer to the most recently active app window |
| - extensions::AppWindow* last_active_app_window_; |
| + ui::BaseWindow* last_active_window_ = nullptr; |
| // The launcher id associated with this set of windows. There is one |
| // AppLauncherItemController for each |app_shelf_id_|. |