Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: ui/app_list/views/apps_container_view.cc

Issue 162753002: Center and change the aspect ratio for the experimental app list. [Win] (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix android compile Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « ui/app_list/views/app_list_folder_view.cc ('k') | ui/app_list/views/apps_grid_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/app_list/views/folder_background_view.h" 18 #include "ui/app_list/views/folder_background_view.h"
17 #include "ui/events/event.h" 19 #include "ui/events/event.h"
18 20
19 namespace app_list { 21 namespace app_list {
20 22
21 AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view, 23 AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view,
22 PaginationModel* pagination_model, 24 PaginationModel* pagination_model,
23 AppListModel* model, 25 AppListModel* model,
24 content::WebContents* start_page_contents) 26 content::WebContents* start_page_contents)
25 : model_(model), 27 : model_(model),
26 show_state_(SHOW_APPS), 28 show_state_(SHOW_APPS),
27 top_icon_animation_pending_count_(0) { 29 top_icon_animation_pending_count_(0) {
28 apps_grid_view_ = new AppsGridView( 30 apps_grid_view_ = new AppsGridView(
29 app_list_main_view, pagination_model, start_page_contents); 31 app_list_main_view, pagination_model, start_page_contents);
30 apps_grid_view_->SetLayout(kPreferredIconDimension, 32 int cols = kPreferredCols;
31 kPreferredCols, 33 int rows = kPreferredRows;
32 kPreferredRows); 34 if (CommandLine::ForCurrentProcess()->HasSwitch(
35 app_list::switches::kEnableExperimentalAppList)) {
36 cols = kExperimentalPreferredCols;
37 rows = kExperimentalPreferredRows;
38 }
39 apps_grid_view_->SetLayout(kPreferredIconDimension, cols, rows);
33 AddChildView(apps_grid_view_); 40 AddChildView(apps_grid_view_);
34 41
35 folder_background_view_ = new FolderBackgroundView(); 42 folder_background_view_ = new FolderBackgroundView();
36 AddChildView(folder_background_view_); 43 AddChildView(folder_background_view_);
37 44
38 app_list_folder_view_ = new AppListFolderView( 45 app_list_folder_view_ = new AppListFolderView(
39 this, 46 this,
40 model, 47 model,
41 app_list_main_view, 48 app_list_main_view,
42 start_page_contents); 49 start_page_contents);
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
202 void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) { 209 void AppsContainerView::PrepareToShowApps(AppListFolderItem* folder_item) {
203 if (folder_item) 210 if (folder_item)
204 CreateViewsForFolderTopItemsAnimation(folder_item, false); 211 CreateViewsForFolderTopItemsAnimation(folder_item, false);
205 212
206 // Hide the active folder item until the animation completes. 213 // Hide the active folder item until the animation completes.
207 if (apps_grid_view_->activated_item_view()) 214 if (apps_grid_view_->activated_item_view())
208 apps_grid_view_->activated_item_view()->SetVisible(false); 215 apps_grid_view_->activated_item_view()->SetVisible(false);
209 } 216 }
210 217
211 } // namespace app_list 218 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/app_list_folder_view.cc ('k') | ui/app_list/views/apps_grid_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698