summaryrefslogtreecommitdiffstats
path: root/ash/wm/app_list_controller.h
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-30 14:53:34 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-04-30 14:53:34 +0000
commit4f08470c76d8bb2b8959d06eac0f58671940b395 (patch)
tree67cbfca6085cc3c2f8b28041d6be44655e8efd3f /ash/wm/app_list_controller.h
parent61f790d9313c405c54159dd65f4dc473fd0c43fa (diff)
downloadchromium_src-4f08470c76d8bb2b8959d06eac0f58671940b395.zip
chromium_src-4f08470c76d8bb2b8959d06eac0f58671940b395.tar.gz
chromium_src-4f08470c76d8bb2b8959d06eac0f58671940b395.tar.bz2
ash: Update app list button.
- Update the icons assets; - Make app list button a ToggleImageButton and wire its toggle state with app list UI visibility; - Make app list button icon vertically center aligned and get rid of the special handling; - Expose toggled state from ToggleImageButton so that it could be checked in test; BUG=235994 R=sky@chromium.org Review URL: https://codereview.chromium.org/13993027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@197366 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/wm/app_list_controller.h')
-rw-r--r--ash/wm/app_list_controller.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/ash/wm/app_list_controller.h b/ash/wm/app_list_controller.h
index d2408d8..385e1e5 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);
};