| 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 12 matching lines...) Expand all Loading... |
| 23 | 23 |
| 24 AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view, | 24 AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view, |
| 25 PaginationModel* pagination_model, | 25 PaginationModel* pagination_model, |
| 26 AppListModel* model) | 26 AppListModel* model) |
| 27 : model_(model), | 27 : model_(model), |
| 28 show_state_(SHOW_NONE), | 28 show_state_(SHOW_NONE), |
| 29 top_icon_animation_pending_count_(0) { | 29 top_icon_animation_pending_count_(0) { |
| 30 apps_grid_view_ = new AppsGridView(app_list_main_view, pagination_model); | 30 apps_grid_view_ = new AppsGridView(app_list_main_view, pagination_model); |
| 31 int cols = kPreferredCols; | 31 int cols = kPreferredCols; |
| 32 int rows = kPreferredRows; | 32 int rows = kPreferredRows; |
| 33 if (app_list::switches::IsExperimentalAppListPositionEnabled()) { | 33 // IsAppListCentered also implies that it is wide instead of tall. |
| 34 if (app_list::switches::IsAppListCentered()) { |
| 34 cols = kExperimentalPreferredCols; | 35 cols = kExperimentalPreferredCols; |
| 35 rows = kExperimentalPreferredRows; | 36 rows = kExperimentalPreferredRows; |
| 36 } | 37 } |
| 37 apps_grid_view_->SetLayout(kPreferredIconDimension, cols, rows); | 38 apps_grid_view_->SetLayout(kPreferredIconDimension, cols, rows); |
| 38 AddChildView(apps_grid_view_); | 39 AddChildView(apps_grid_view_); |
| 39 | 40 |
| 40 folder_background_view_ = new FolderBackgroundView(); | 41 folder_background_view_ = new FolderBackgroundView(); |
| 41 AddChildView(folder_background_view_); | 42 AddChildView(folder_background_view_); |
| 42 | 43 |
| 43 app_list_folder_view_ = | 44 app_list_folder_view_ = |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) { | 226 void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) { |
| 226 if (folder_item) | 227 if (folder_item) |
| 227 CreateViewsForFolderTopItemsAnimation(folder_item, false); | 228 CreateViewsForFolderTopItemsAnimation(folder_item, false); |
| 228 | 229 |
| 229 // Hide the active folder item until the animation completes. | 230 // Hide the active folder item until the animation completes. |
| 230 if (apps_grid_view_->activated_item_view()) | 231 if (apps_grid_view_->activated_item_view()) |
| 231 apps_grid_view_->activated_item_view()->SetVisible(false); | 232 apps_grid_view_->activated_item_view()->SetVisible(false); |
| 232 } | 233 } |
| 233 | 234 |
| 234 } // namespace app_list | 235 } // namespace app_list |
| OLD | NEW |