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

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

Issue 2959943003: Replace AllAppsTileItemView with ArrowExpandView (Closed)
Patch Set: Find possible reason for memory leak Created 3 years, 5 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/start_page_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/suggestions_container_view.h" 5 #include "ui/app_list/views/suggestions_container_view.h"
6 6
7 #include "ui/app_list/app_list_constants.h" 7 #include "ui/app_list/app_list_constants.h"
8 #include "ui/app_list/app_list_features.h" 8 #include "ui/app_list/app_list_features.h"
9 #include "ui/app_list/views/all_apps_tile_item_view.h" 9 #include "ui/app_list/views/all_apps_tile_item_view.h"
10 #include "ui/app_list/views/app_list_main_view.h" 10 #include "ui/app_list/views/app_list_main_view.h"
11 #include "ui/app_list/views/contents_view.h" 11 #include "ui/app_list/views/contents_view.h"
12 #include "ui/app_list/views/search_result_tile_item_view.h" 12 #include "ui/app_list/views/search_result_tile_item_view.h"
13 #include "ui/views/background.h" 13 #include "ui/views/background.h"
14 #include "ui/views/layout/grid_layout.h" 14 #include "ui/views/layout/grid_layout.h"
15 15
16 namespace app_list { 16 namespace app_list {
17 17
18 namespace { 18 namespace {
19 19
20 constexpr int kTileSpacing = 7; 20 constexpr int kTileSpacing = 7;
21 constexpr int kNumTilesCols = 5; 21 constexpr int kNumTilesCols = 5;
22 constexpr int kTilesHorizontalMarginLeft = 145; 22 constexpr int kTilesHorizontalMarginLeft = 145;
23 constexpr int kCenterColumnOfStartPageAppGrid = 3;
24 23
25 } // namespace 24 } // namespace
26 25
27 SuggestionsContainerView::SuggestionsContainerView( 26 SuggestionsContainerView::SuggestionsContainerView(
28 ContentsView* contents_view, 27 ContentsView* contents_view,
29 AllAppsTileItemView* all_apps_button) 28 AllAppsTileItemView* all_apps_button)
30 : contents_view_(contents_view), 29 : contents_view_(contents_view),
31 all_apps_button_(all_apps_button), 30 all_apps_button_(all_apps_button),
32 is_fullscreen_app_list_enabled_(features::IsFullscreenAppListEnabled()) { 31 is_fullscreen_app_list_enabled_(features::IsFullscreenAppListEnabled()) {
33 DCHECK(contents_view); 32 DCHECK(contents_view);
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 new SearchResultTileItemView(this, view_delegate_); 140 new SearchResultTileItemView(this, view_delegate_);
142 if (i % kNumTilesCols == 0) 141 if (i % kNumTilesCols == 0)
143 tiles_layout_manager->StartRow(0, 0); 142 tiles_layout_manager->StartRow(0, 0);
144 tiles_layout_manager->AddView(tile_item); 143 tiles_layout_manager->AddView(tile_item);
145 AddChildView(tile_item); 144 AddChildView(tile_item);
146 tile_item->SetParentBackgroundColor(kLabelBackgroundColor); 145 tile_item->SetParentBackgroundColor(kLabelBackgroundColor);
147 tile_item->SetHoverStyle(TileItemView::HOVER_STYLE_ANIMATE_SHADOW); 146 tile_item->SetHoverStyle(TileItemView::HOVER_STYLE_ANIMATE_SHADOW);
148 search_result_tile_views_.emplace_back(tile_item); 147 search_result_tile_views_.emplace_back(tile_item);
149 } 148 }
150 149
151 if (all_apps_button_) 150 if (all_apps_button_ && !is_fullscreen_app_list_enabled_) {
152 all_apps_button_->UpdateIcon(); 151 all_apps_button_->UpdateIcon();
153 if (is_fullscreen_app_list_enabled_) { 152
154 // Also add a special "all apps" button to the middle of the next row of the
155 // container.
156 tiles_layout_manager->StartRow(0, 0);
157 tiles_layout_manager->SkipColumns(kCenterColumnOfStartPageAppGrid);
158 } else {
159 // Also add a special "all apps" button to the end of the next row of the 153 // Also add a special "all apps" button to the end of the next row of the
160 // container. 154 // container.
161 if (i % kNumTilesCols == 0) 155 if (i % kNumTilesCols == 0)
162 tiles_layout_manager->StartRow(0, 0); 156 tiles_layout_manager->StartRow(0, 0);
163 }
164 157
165 if (all_apps_button_) {
166 tiles_layout_manager->AddView(all_apps_button_); 158 tiles_layout_manager->AddView(all_apps_button_);
167 AddChildView(all_apps_button_); 159 AddChildView(all_apps_button_);
168 } 160 }
169 } 161 }
170 162
171 } // namespace app_list 163 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/start_page_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698