| 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 | 8 |
| 9 #include "base/command_line.h" |
| 9 #include "ui/app_list/app_list_constants.h" | 10 #include "ui/app_list/app_list_constants.h" |
| 10 #include "ui/app_list/app_list_folder_item.h" | 11 #include "ui/app_list/app_list_folder_item.h" |
| 12 #include "ui/app_list/app_list_switches.h" |
| 11 #include "ui/app_list/pagination_model.h" | 13 #include "ui/app_list/pagination_model.h" |
| 12 #include "ui/app_list/views/app_list_folder_view.h" | 14 #include "ui/app_list/views/app_list_folder_view.h" |
| 13 #include "ui/app_list/views/app_list_item_view.h" | 15 #include "ui/app_list/views/app_list_item_view.h" |
| 14 #include "ui/app_list/views/app_list_main_view.h" | 16 #include "ui/app_list/views/app_list_main_view.h" |
| 15 #include "ui/app_list/views/apps_grid_view.h" | 17 #include "ui/app_list/views/apps_grid_view.h" |
| 16 #include "ui/compositor/scoped_layer_animation_settings.h" | 18 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 17 #include "ui/events/event.h" | 19 #include "ui/events/event.h" |
| 18 #include "ui/gfx/image/image_skia_operations.h" | 20 #include "ui/gfx/image/image_skia_operations.h" |
| 19 #include "ui/views/controls/image_view.h" | 21 #include "ui/views/controls/image_view.h" |
| 20 | 22 |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 } // namespace | 114 } // namespace |
| 113 | 115 |
| 114 AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view, | 116 AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view, |
| 115 PaginationModel* pagination_model, | 117 PaginationModel* pagination_model, |
| 116 AppListModel* model, | 118 AppListModel* model, |
| 117 content::WebContents* start_page_contents) | 119 content::WebContents* start_page_contents) |
| 118 : model_(model), | 120 : model_(model), |
| 119 show_state_(SHOW_APPS) { | 121 show_state_(SHOW_APPS) { |
| 120 apps_grid_view_ = new AppsGridView( | 122 apps_grid_view_ = new AppsGridView( |
| 121 app_list_main_view, pagination_model, start_page_contents); | 123 app_list_main_view, pagination_model, start_page_contents); |
| 122 apps_grid_view_->SetLayout(kPreferredIconDimension, | 124 int cols = kPreferredCols; |
| 123 kPreferredCols, | 125 int rows = kPreferredRows; |
| 124 kPreferredRows); | 126 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 127 app_list::switches::kEnableExperimentalAppList)) { |
| 128 cols = kExperimentalPreferredCols; |
| 129 rows = kExperimentalPreferredRows; |
| 130 } |
| 131 apps_grid_view_->SetLayout(kPreferredIconDimension, cols, rows); |
| 125 AddChildView(apps_grid_view_); | 132 AddChildView(apps_grid_view_); |
| 126 | 133 |
| 127 app_list_folder_view_ = new AppListFolderView( | 134 app_list_folder_view_ = new AppListFolderView( |
| 128 this, | 135 this, |
| 129 model, | 136 model, |
| 130 app_list_main_view, | 137 app_list_main_view, |
| 131 start_page_contents); | 138 start_page_contents); |
| 132 AddChildView(app_list_folder_view_); | 139 AddChildView(app_list_folder_view_); |
| 133 | 140 |
| 134 apps_grid_view_->SetModel(model_); | 141 apps_grid_view_->SetModel(model_); |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 // same location of the item in the folder list view. | 260 // same location of the item in the folder list view. |
| 254 AddChildView(top_icon_views_[i]); | 261 AddChildView(top_icon_views_[i]); |
| 255 top_icon_views_[i]->SetBoundsRect( | 262 top_icon_views_[i]->SetBoundsRect( |
| 256 app_list_folder_view_->ConvertRectToParent( | 263 app_list_folder_view_->ConvertRectToParent( |
| 257 app_list_folder_view_->GetItemIconBoundsAt(i))); | 264 app_list_folder_view_->GetItemIconBoundsAt(i))); |
| 258 static_cast<TopIconAnimationView*>(top_icon_views_[i])->TransformView(); | 265 static_cast<TopIconAnimationView*>(top_icon_views_[i])->TransformView(); |
| 259 } | 266 } |
| 260 } | 267 } |
| 261 | 268 |
| 262 } // namespace app_list | 269 } // namespace app_list |
| OLD | NEW |