Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1744)

Unified Diff: ash/wm/app_list_controller.h

Issue 13993027: ash: Update app list button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: for #1 Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/shell.cc ('k') | ash/wm/app_list_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « ash/shell.cc ('k') | ash/wm/app_list_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698