OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "ui/app_list/views/apps_container_view.h" | 5 #include "ui/app_list/views/apps_container_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
11 #include "ui/app_list/app_list_constants.h" | 11 #include "ui/app_list/app_list_constants.h" |
12 #include "ui/app_list/app_list_folder_item.h" | 12 #include "ui/app_list/app_list_folder_item.h" |
13 #include "ui/app_list/app_list_switches.h" | 13 #include "ui/app_list/app_list_switches.h" |
14 #include "ui/app_list/pagination_model.h" | |
15 #include "ui/app_list/views/app_list_folder_view.h" | 14 #include "ui/app_list/views/app_list_folder_view.h" |
16 #include "ui/app_list/views/app_list_item_view.h" | 15 #include "ui/app_list/views/app_list_item_view.h" |
17 #include "ui/app_list/views/app_list_main_view.h" | 16 #include "ui/app_list/views/app_list_main_view.h" |
18 #include "ui/app_list/views/apps_grid_view.h" | 17 #include "ui/app_list/views/apps_grid_view.h" |
19 #include "ui/app_list/views/folder_background_view.h" | 18 #include "ui/app_list/views/folder_background_view.h" |
20 #include "ui/events/event.h" | 19 #include "ui/events/event.h" |
21 | 20 |
22 namespace app_list { | 21 namespace app_list { |
23 | 22 |
24 AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view, | 23 AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view, |
25 PaginationModel* pagination_model, | |
26 AppListModel* model) | 24 AppListModel* model) |
27 : model_(model), | 25 : model_(model), |
28 show_state_(SHOW_NONE), | 26 show_state_(SHOW_NONE), |
29 top_icon_animation_pending_count_(0) { | 27 top_icon_animation_pending_count_(0) { |
30 apps_grid_view_ = new AppsGridView(app_list_main_view, pagination_model); | 28 apps_grid_view_ = new AppsGridView(app_list_main_view); |
31 int cols = kPreferredCols; | 29 int cols = kPreferredCols; |
32 int rows = kPreferredRows; | 30 int rows = kPreferredRows; |
33 // ShouldCenterWindow also implies that it is wide instead of tall. | 31 // ShouldCenterWindow also implies that it is wide instead of tall. |
34 if (app_list_main_view->ShouldCenterWindow()) { | 32 if (app_list_main_view->ShouldCenterWindow()) { |
35 cols = kExperimentalPreferredCols; | 33 cols = kExperimentalPreferredCols; |
36 rows = kExperimentalPreferredRows; | 34 rows = kExperimentalPreferredRows; |
37 } | 35 } |
38 apps_grid_view_->SetLayout(kPreferredIconDimension, cols, rows); | 36 apps_grid_view_->SetLayout(kPreferredIconDimension, cols, rows); |
39 AddChildView(apps_grid_view_); | 37 AddChildView(apps_grid_view_); |
40 | 38 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) { | 230 void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) { |
233 if (folder_item) | 231 if (folder_item) |
234 CreateViewsForFolderTopItemsAnimation(folder_item, false); | 232 CreateViewsForFolderTopItemsAnimation(folder_item, false); |
235 | 233 |
236 // Hide the active folder item until the animation completes. | 234 // Hide the active folder item until the animation completes. |
237 if (apps_grid_view_->activated_folder_item_view()) | 235 if (apps_grid_view_->activated_folder_item_view()) |
238 apps_grid_view_->activated_folder_item_view()->SetVisible(false); | 236 apps_grid_view_->activated_folder_item_view()->SetVisible(false); |
239 } | 237 } |
240 | 238 |
241 } // namespace app_list | 239 } // namespace app_list |
OLD | NEW |