| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <list> | 8 #include <list> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "ash/public/cpp/shelf_item_delegate.h" | 11 #include "ash/public/cpp/shelf_item_delegate.h" |
| 12 #include "base/macros.h" | 12 #include "base/macros.h" |
| 13 #include "base/scoped_observer.h" | 13 #include "base/scoped_observer.h" |
| 14 #include "ui/aura/window_observer.h" | 14 #include "ui/aura/window_observer.h" |
| 15 | 15 |
| 16 namespace aura { | 16 namespace aura { |
| 17 class Window; | 17 class Window; |
| 18 } | 18 } |
| 19 | 19 |
| 20 namespace ui { | 20 namespace ui { |
| 21 class BaseWindow; | 21 class BaseWindow; |
| 22 } | 22 } |
| 23 | 23 |
| 24 // This is a ShelfItemDelegate for abstract app windows (extension or ARC). | 24 // This is a ShelfItemDelegate for abstract app windows (extension or ARC). |
| 25 // There is one instance per app, per launcher id. For apps with multiple | 25 // There is one instance per app, per launcher id. For apps with multiple |
| 26 // windows, each item controller keeps track of all windows associated with the | 26 // windows, each item controller keeps track of all windows associated with the |
| 27 // app and their activation order. Instances are owned by ash::ShelfModel. | 27 // app and their activation order. Instances are owned by ash::ShelfModel. |
| 28 // | 28 // |
| 29 // Tests are in chrome_launcher_controller_impl_browsertest.cc | 29 // Tests are in chrome_launcher_controller_browsertest.cc |
| 30 class AppWindowLauncherItemController : public ash::ShelfItemDelegate, | 30 class AppWindowLauncherItemController : public ash::ShelfItemDelegate, |
| 31 public aura::WindowObserver { | 31 public aura::WindowObserver { |
| 32 public: | 32 public: |
| 33 using WindowList = std::list<ui::BaseWindow*>; | 33 using WindowList = std::list<ui::BaseWindow*>; |
| 34 | 34 |
| 35 ~AppWindowLauncherItemController() override; | 35 ~AppWindowLauncherItemController() override; |
| 36 | 36 |
| 37 void AddWindow(ui::BaseWindow* window); | 37 void AddWindow(ui::BaseWindow* window); |
| 38 void RemoveWindow(ui::BaseWindow* window); | 38 void RemoveWindow(ui::BaseWindow* window); |
| 39 | 39 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // Pointer to the most recently active app window | 89 // Pointer to the most recently active app window |
| 90 ui::BaseWindow* last_active_window_ = nullptr; | 90 ui::BaseWindow* last_active_window_ = nullptr; |
| 91 | 91 |
| 92 // Scoped list of observed windows (for removal on destruction) | 92 // Scoped list of observed windows (for removal on destruction) |
| 93 ScopedObserver<aura::Window, aura::WindowObserver> observed_windows_; | 93 ScopedObserver<aura::Window, aura::WindowObserver> observed_windows_; |
| 94 | 94 |
| 95 DISALLOW_COPY_AND_ASSIGN(AppWindowLauncherItemController); | 95 DISALLOW_COPY_AND_ASSIGN(AppWindowLauncherItemController); |
| 96 }; | 96 }; |
| 97 | 97 |
| 98 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ | 98 #endif // CHROME_BROWSER_UI_ASH_LAUNCHER_APP_WINDOW_LAUNCHER_ITEM_CONTROLLER_H_ |
| OLD | NEW |