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/keyboard/keyboard_controller_observer.h" |
20 #include "ui/views/widget/widget_observer.h" | 20 #include "ui/views/widget/widget_observer.h" |
21 | 21 |
22 namespace app_list { | 22 namespace app_list { |
23 class ApplicationDragAndDropHost; | 23 class ApplicationDragAndDropHost; |
24 class AppListView; | 24 class AppListView; |
25 class PaginationModel; | |
26 } | 25 } |
27 | 26 |
28 namespace ui { | 27 namespace ui { |
29 class LocatedEvent; | 28 class LocatedEvent; |
30 } | 29 } |
31 | 30 |
32 namespace ash { | 31 namespace ash { |
33 namespace test { | 32 namespace test { |
34 class AppListControllerTestApi; | 33 class AppListControllerTestApi; |
35 } | 34 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 | 117 |
119 // ShelfIconObserver overrides: | 118 // ShelfIconObserver overrides: |
120 virtual void OnShelfIconPositionsChanged() OVERRIDE; | 119 virtual void OnShelfIconPositionsChanged() OVERRIDE; |
121 | 120 |
122 // app_list::PaginationModelObserver overrides: | 121 // app_list::PaginationModelObserver overrides: |
123 virtual void TotalPagesChanged() OVERRIDE; | 122 virtual void TotalPagesChanged() OVERRIDE; |
124 virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE; | 123 virtual void SelectedPageChanged(int old_selected, int new_selected) OVERRIDE; |
125 virtual void TransitionStarted() OVERRIDE; | 124 virtual void TransitionStarted() OVERRIDE; |
126 virtual void TransitionChanged() OVERRIDE; | 125 virtual void TransitionChanged() OVERRIDE; |
127 | 126 |
128 scoped_ptr<app_list::PaginationModel> pagination_model_; | |
129 | |
130 // Whether we should show or hide app list widget. | 127 // Whether we should show or hide app list widget. |
131 bool is_visible_; | 128 bool is_visible_; |
132 | 129 |
133 // Whether the app list should remain centered. | 130 // Whether the app list should remain centered. |
134 bool is_centered_; | 131 bool is_centered_; |
135 | 132 |
136 // The AppListView this class manages, owned by its widget. | 133 // The AppListView this class manages, owned by its widget. |
137 app_list::AppListView* view_; | 134 app_list::AppListView* view_; |
138 | 135 |
| 136 // The current page of the AppsGridView of |view_|. This is stored outside of |
| 137 // the view's PaginationModel, so that it persists when the view is destroyed. |
| 138 int current_app_page_; |
| 139 |
139 // Cached bounds of |view_| for snapping back animation after over-scroll. | 140 // Cached bounds of |view_| for snapping back animation after over-scroll. |
140 gfx::Rect view_bounds_; | 141 gfx::Rect view_bounds_; |
141 | 142 |
142 // Whether should schedule snap back animation. | 143 // Whether should schedule snap back animation. |
143 bool should_snap_back_; | 144 bool should_snap_back_; |
144 | 145 |
145 DISALLOW_COPY_AND_ASSIGN(AppListController); | 146 DISALLOW_COPY_AND_ASSIGN(AppListController); |
146 }; | 147 }; |
147 | 148 |
148 } // namespace ash | 149 } // namespace ash |
149 | 150 |
150 #endif // ASH_WM_APP_LIST_CONTROLLER_H_ | 151 #endif // ASH_WM_APP_LIST_CONTROLLER_H_ |
OLD | NEW |