OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 ASH_WM_APP_LIST_CONTROLLER_H_ | 5 #ifndef ASH_WM_APP_LIST_CONTROLLER_H_ |
6 #define ASH_WM_APP_LIST_CONTROLLER_H_ | 6 #define ASH_WM_APP_LIST_CONTROLLER_H_ |
7 | 7 |
8 #include "ash/launcher/launcher_icon_observer.h" | 8 #include "ash/shelf/shelf_icon_observer.h" |
9 #include "ash/shell_observer.h" | 9 #include "ash/shell_observer.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
12 #include "base/timer/timer.h" | 12 #include "base/timer/timer.h" |
13 #include "ui/app_list/pagination_model_observer.h" | 13 #include "ui/app_list/pagination_model_observer.h" |
14 #include "ui/aura/client/focus_change_observer.h" | 14 #include "ui/aura/client/focus_change_observer.h" |
15 #include "ui/aura/window_observer.h" | 15 #include "ui/aura/window_observer.h" |
16 #include "ui/compositor/layer_animation_observer.h" | 16 #include "ui/compositor/layer_animation_observer.h" |
17 #include "ui/events/event_handler.h" | 17 #include "ui/events/event_handler.h" |
18 #include "ui/gfx/rect.h" | 18 #include "ui/gfx/rect.h" |
(...skipping 19 matching lines...) Expand all Loading... |
38 // AppListController is a controller that manages app list UI for shell. | 38 // AppListController is a controller that manages app list UI for shell. |
39 // It creates AppListView and schedules showing/hiding animation. | 39 // It creates AppListView and schedules showing/hiding animation. |
40 // While the UI is visible, it monitors things such as app list widget's | 40 // While the UI is visible, it monitors things such as app list widget's |
41 // activation state and desktop mouse click to auto dismiss the UI. | 41 // activation state and desktop mouse click to auto dismiss the UI. |
42 class AppListController : public ui::EventHandler, | 42 class AppListController : public ui::EventHandler, |
43 public aura::client::FocusChangeObserver, | 43 public aura::client::FocusChangeObserver, |
44 public aura::WindowObserver, | 44 public aura::WindowObserver, |
45 public ui::ImplicitAnimationObserver, | 45 public ui::ImplicitAnimationObserver, |
46 public views::WidgetObserver, | 46 public views::WidgetObserver, |
47 public ShellObserver, | 47 public ShellObserver, |
48 public LauncherIconObserver, | 48 public ShelfIconObserver, |
49 public app_list::PaginationModelObserver { | 49 public app_list::PaginationModelObserver { |
50 public: | 50 public: |
51 AppListController(); | 51 AppListController(); |
52 virtual ~AppListController(); | 52 virtual ~AppListController(); |
53 | 53 |
54 // Show/hide app list window. The |window| is used to deterime in | 54 // Show/hide app list window. The |window| is used to deterime in |
55 // which display (in which the |window| exists) the app list should | 55 // which display (in which the |window| exists) the app list should |
56 // be shown. | 56 // be shown. |
57 void SetVisible(bool visible, aura::Window* window); | 57 void SetVisible(bool visible, aura::Window* window); |
58 | 58 |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 | 106 |
107 // ui::ImplicitAnimationObserver overrides: | 107 // ui::ImplicitAnimationObserver overrides: |
108 virtual void OnImplicitAnimationsCompleted() OVERRIDE; | 108 virtual void OnImplicitAnimationsCompleted() OVERRIDE; |
109 | 109 |
110 // views::WidgetObserver overrides: | 110 // views::WidgetObserver overrides: |
111 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; | 111 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; |
112 | 112 |
113 // ShellObserver overrides: | 113 // ShellObserver overrides: |
114 virtual void OnShelfAlignmentChanged(aura::Window* root_window) OVERRIDE; | 114 virtual void OnShelfAlignmentChanged(aura::Window* root_window) OVERRIDE; |
115 | 115 |
116 // LauncherIconObserver overrides: | 116 // ShelfIconObserver overrides: |
117 virtual void OnLauncherIconPositionsChanged() OVERRIDE; | 117 virtual void OnShelfIconPositionsChanged() OVERRIDE; |
118 | 118 |
119 // app_list::PaginationModelObserver overrides: | 119 // app_list::PaginationModelObserver overrides: |
120 virtual void TotalPagesChanged() OVERRIDE; | 120 virtual void TotalPagesChanged() OVERRIDE; |
121 virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE; | 121 virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE; |
122 virtual void TransitionStarted() OVERRIDE; | 122 virtual void TransitionStarted() OVERRIDE; |
123 virtual void TransitionChanged() OVERRIDE; | 123 virtual void TransitionChanged() OVERRIDE; |
124 | 124 |
125 scoped_ptr<app_list::PaginationModel> pagination_model_; | 125 scoped_ptr<app_list::PaginationModel> pagination_model_; |
126 | 126 |
127 // Whether we should show or hide app list widget. | 127 // Whether we should show or hide app list widget. |
128 bool is_visible_; | 128 bool is_visible_; |
129 | 129 |
130 // The AppListView this class manages, owned by its widget. | 130 // The AppListView this class manages, owned by its widget. |
131 app_list::AppListView* view_; | 131 app_list::AppListView* view_; |
132 | 132 |
133 // Cached bounds of |view_| for snapping back animation after over-scroll. | 133 // Cached bounds of |view_| for snapping back animation after over-scroll. |
134 gfx::Rect view_bounds_; | 134 gfx::Rect view_bounds_; |
135 | 135 |
136 // Whether should schedule snap back animation. | 136 // Whether should schedule snap back animation. |
137 bool should_snap_back_; | 137 bool should_snap_back_; |
138 | 138 |
139 DISALLOW_COPY_AND_ASSIGN(AppListController); | 139 DISALLOW_COPY_AND_ASSIGN(AppListController); |
140 }; | 140 }; |
141 | 141 |
142 } // namespace internal | 142 } // namespace internal |
143 } // namespace ash | 143 } // namespace ash |
144 | 144 |
145 #endif // ASH_WM_APP_LIST_CONTROLLER_H_ | 145 #endif // ASH_WM_APP_LIST_CONTROLLER_H_ |
OLD | NEW |