| Index: ash/wm/app_list_controller.h
|
| diff --git a/ash/wm/app_list_controller.h b/ash/wm/app_list_controller.h
|
| index d2408d8bac4afba0be8384b8eb541311b07a71eb..385e1e5af630ab2f75f3639907ac3e88e7ad55bf 100644
|
| --- a/ash/wm/app_list_controller.h
|
| +++ b/ash/wm/app_list_controller.h
|
| @@ -9,6 +9,7 @@
|
| #include "ash/shell_observer.h"
|
| #include "base/basictypes.h"
|
| #include "base/compiler_specific.h"
|
| +#include "base/observer_list.h"
|
| #include "base/timer.h"
|
| #include "ui/app_list/pagination_model_observer.h"
|
| #include "ui/aura/client/focus_change_observer.h"
|
| @@ -28,8 +29,13 @@ class LocatedEvent;
|
| }
|
|
|
| namespace ash {
|
| +
|
| +class Shell;
|
| +
|
| namespace internal {
|
|
|
| +class AppListControllerObserver;
|
| +
|
| // AppListController is a controller that manages app list UI for shell.
|
| // It creates AppListView and schedules showing/hiding animation.
|
| // While the UI is visible, it monitors things such as app list widget's
|
| @@ -43,9 +49,12 @@ class AppListController : public ui::EventHandler,
|
| public LauncherIconObserver,
|
| public app_list::PaginationModelObserver {
|
| public:
|
| - AppListController();
|
| + explicit AppListController(Shell* shell);
|
| virtual ~AppListController();
|
|
|
| + // Closes opened app list and cleans up its dependency on shell.
|
| + void Shutdown();
|
| +
|
| // Show/hide app list window. The |window| is used to deterime in
|
| // which display (in which the |window| exists) the app list should
|
| // be shown.
|
| @@ -54,6 +63,10 @@ class AppListController : public ui::EventHandler,
|
| // Whether app list window is visible (shown or being shown).
|
| bool IsVisible() const;
|
|
|
| + // Convenience wrapper to toggle visibility using the SetVisible() and
|
| + // IsVisible().
|
| + void Toggle(aura::Window* window);
|
| +
|
| // Returns target visibility. This differs from IsVisible() if an animation
|
| // is ongoing.
|
| bool GetTargetVisibility() const { return is_visible_; }
|
| @@ -61,6 +74,9 @@ class AppListController : public ui::EventHandler,
|
| // Returns app list window or NULL if it is not visible.
|
| aura::Window* GetWindow();
|
|
|
| + void AddObserver(AppListControllerObserver* observer);
|
| + void RemoveObserver(AppListControllerObserver* observer);
|
| +
|
| private:
|
| // Sets the app list view and attempts to show it.
|
| void SetView(app_list::AppListView* view);
|
| @@ -105,6 +121,8 @@ class AppListController : public ui::EventHandler,
|
| virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE;
|
| virtual void TransitionChanged() OVERRIDE;
|
|
|
| + Shell* shell_;
|
| +
|
| scoped_ptr<app_list::PaginationModel> pagination_model_;
|
|
|
| // Whether we should show or hide app list widget.
|
| @@ -119,6 +137,8 @@ class AppListController : public ui::EventHandler,
|
| // Whether should schedule snap back animation.
|
| bool should_snap_back_;
|
|
|
| + ObserverList<AppListControllerObserver, true> observers_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(AppListController);
|
| };
|
|
|
|
|