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/shelf/shelf_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" |
| 19 #include "ui/keyboard/keyboard_controller_observer.h" |
19 #include "ui/views/widget/widget_observer.h" | 20 #include "ui/views/widget/widget_observer.h" |
20 | 21 |
21 namespace app_list { | 22 namespace app_list { |
22 class ApplicationDragAndDropHost; | 23 class ApplicationDragAndDropHost; |
23 class AppListView; | 24 class AppListView; |
24 class PaginationModel; | 25 class PaginationModel; |
25 } | 26 } |
26 | 27 |
27 namespace ui { | 28 namespace ui { |
28 class LocatedEvent; | 29 class LocatedEvent; |
29 } | 30 } |
30 | 31 |
31 namespace ash { | 32 namespace ash { |
32 namespace test { | 33 namespace test { |
33 class AppListControllerTestApi; | 34 class AppListControllerTestApi; |
34 } | 35 } |
35 | 36 |
36 // AppListController is a controller that manages app list UI for shell. | 37 // AppListController is a controller that manages app list UI for shell. |
37 // It creates AppListView and schedules showing/hiding animation. | 38 // It creates AppListView and schedules showing/hiding animation. |
38 // While the UI is visible, it monitors things such as app list widget's | 39 // While the UI is visible, it monitors things such as app list widget's |
39 // activation state and desktop mouse click to auto dismiss the UI. | 40 // activation state and desktop mouse click to auto dismiss the UI. |
40 class AppListController : public ui::EventHandler, | 41 class AppListController : public ui::EventHandler, |
41 public aura::client::FocusChangeObserver, | 42 public aura::client::FocusChangeObserver, |
42 public aura::WindowObserver, | 43 public aura::WindowObserver, |
43 public ui::ImplicitAnimationObserver, | 44 public ui::ImplicitAnimationObserver, |
44 public views::WidgetObserver, | 45 public views::WidgetObserver, |
| 46 public keyboard::KeyboardControllerObserver, |
45 public ShellObserver, | 47 public ShellObserver, |
46 public ShelfIconObserver, | 48 public ShelfIconObserver, |
47 public app_list::PaginationModelObserver { | 49 public app_list::PaginationModelObserver { |
48 public: | 50 public: |
49 AppListController(); | 51 AppListController(); |
50 virtual ~AppListController(); | 52 virtual ~AppListController(); |
51 | 53 |
52 // 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 |
53 // which display (in which the |window| exists) the app list should | 55 // which display (in which the |window| exists) the app list should |
54 // be shown. | 56 // be shown. |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 virtual void OnWindowBoundsChanged(aura::Window* root, | 103 virtual void OnWindowBoundsChanged(aura::Window* root, |
102 const gfx::Rect& old_bounds, | 104 const gfx::Rect& old_bounds, |
103 const gfx::Rect& new_bounds) OVERRIDE; | 105 const gfx::Rect& new_bounds) OVERRIDE; |
104 | 106 |
105 // ui::ImplicitAnimationObserver overrides: | 107 // ui::ImplicitAnimationObserver overrides: |
106 virtual void OnImplicitAnimationsCompleted() OVERRIDE; | 108 virtual void OnImplicitAnimationsCompleted() OVERRIDE; |
107 | 109 |
108 // views::WidgetObserver overrides: | 110 // views::WidgetObserver overrides: |
109 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; | 111 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; |
110 | 112 |
| 113 // KeyboardControllerObserver overrides: |
| 114 virtual void OnKeyboardBoundsChanging(const gfx::Rect& new_bounds) OVERRIDE; |
| 115 |
111 // ShellObserver overrides: | 116 // ShellObserver overrides: |
112 virtual void OnShelfAlignmentChanged(aura::Window* root_window) OVERRIDE; | 117 virtual void OnShelfAlignmentChanged(aura::Window* root_window) OVERRIDE; |
113 | 118 |
114 // ShelfIconObserver overrides: | 119 // ShelfIconObserver overrides: |
115 virtual void OnShelfIconPositionsChanged() OVERRIDE; | 120 virtual void OnShelfIconPositionsChanged() OVERRIDE; |
116 | 121 |
117 // app_list::PaginationModelObserver overrides: | 122 // app_list::PaginationModelObserver overrides: |
118 virtual void TotalPagesChanged() OVERRIDE; | 123 virtual void TotalPagesChanged() OVERRIDE; |
119 virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE; | 124 virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE; |
120 virtual void TransitionStarted() OVERRIDE; | 125 virtual void TransitionStarted() OVERRIDE; |
(...skipping 15 matching lines...) Expand all Loading... |
136 | 141 |
137 // Whether should schedule snap back animation. | 142 // Whether should schedule snap back animation. |
138 bool should_snap_back_; | 143 bool should_snap_back_; |
139 | 144 |
140 DISALLOW_COPY_AND_ASSIGN(AppListController); | 145 DISALLOW_COPY_AND_ASSIGN(AppListController); |
141 }; | 146 }; |
142 | 147 |
143 } // namespace ash | 148 } // namespace ash |
144 | 149 |
145 #endif // ASH_WM_APP_LIST_CONTROLLER_H_ | 150 #endif // ASH_WM_APP_LIST_CONTROLLER_H_ |
OLD | NEW |