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" |
(...skipping 10 matching lines...) Expand all Loading... | |
21 namespace app_list { | 21 namespace app_list { |
22 | 22 |
23 AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view, | 23 AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view, |
24 AppListModel* model) | 24 AppListModel* model) |
25 : model_(model), | 25 : model_(model), |
26 show_state_(SHOW_NONE), | 26 show_state_(SHOW_NONE), |
27 top_icon_animation_pending_count_(0) { | 27 top_icon_animation_pending_count_(0) { |
28 apps_grid_view_ = new AppsGridView(app_list_main_view); | 28 apps_grid_view_ = new AppsGridView(app_list_main_view); |
29 int cols = kPreferredCols; | 29 int cols = kPreferredCols; |
30 int rows = kPreferredRows; | 30 int rows = kPreferredRows; |
31 // ShouldCenterWindow also implies that it is wide instead of tall. | 31 if (switches::IsExperimentalAppListEnabled()) { |
32 if (app_list_main_view->ShouldCenterWindow()) { | |
33 cols = kExperimentalPreferredCols; | 32 cols = kExperimentalPreferredCols; |
34 rows = kExperimentalPreferredRows; | 33 rows = kExperimentalPreferredRows; |
34 } else if (app_list_main_view->ShouldCenterWindow()) { | |
35 cols = kCenteredPreferredCols; | |
36 rows = kCenteredPreferredRows; | |
35 } | 37 } |
Matt Giuca
2014/09/16 06:39:40
optional nit: I think I would prefer declaring the
calamity
2014/09/16 06:55:12
Done.
| |
36 apps_grid_view_->SetLayout(cols, rows); | 38 apps_grid_view_->SetLayout(cols, rows); |
37 AddChildView(apps_grid_view_); | 39 AddChildView(apps_grid_view_); |
38 | 40 |
39 folder_background_view_ = new FolderBackgroundView(); | 41 folder_background_view_ = new FolderBackgroundView(); |
40 AddChildView(folder_background_view_); | 42 AddChildView(folder_background_view_); |
41 | 43 |
42 app_list_folder_view_ = | 44 app_list_folder_view_ = |
43 new AppListFolderView(this, model, app_list_main_view); | 45 new AppListFolderView(this, model, app_list_main_view); |
44 // The folder view is initially hidden. | 46 // The folder view is initially hidden. |
45 app_list_folder_view_->SetVisible(false); | 47 app_list_folder_view_->SetVisible(false); |
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
230 void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) { | 232 void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) { |
231 if (folder_item) | 233 if (folder_item) |
232 CreateViewsForFolderTopItemsAnimation(folder_item, false); | 234 CreateViewsForFolderTopItemsAnimation(folder_item, false); |
233 | 235 |
234 // Hide the active folder item until the animation completes. | 236 // Hide the active folder item until the animation completes. |
235 if (apps_grid_view_->activated_folder_item_view()) | 237 if (apps_grid_view_->activated_folder_item_view()) |
236 apps_grid_view_->activated_folder_item_view()->SetVisible(false); | 238 apps_grid_view_->activated_folder_item_view()->SetVisible(false); |
237 } | 239 } |
238 | 240 |
239 } // namespace app_list | 241 } // namespace app_list |
OLD | NEW |