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

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

Issue 796793002: Make app list recommendations into their own DisplayType. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mathp_suggestions_search
Patch Set: fix_test Created 6 years 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_view_unittest.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/start_page_view.h" 5 #include "ui/app_list/views/start_page_view.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "ui/app_list/app_list_constants.h" 8 #include "ui/app_list/app_list_constants.h"
9 #include "ui/app_list/app_list_item.h" 9 #include "ui/app_list/app_list_item.h"
10 #include "ui/app_list/app_list_model.h" 10 #include "ui/app_list/app_list_model.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 void StartPageView::OnContainerSelected(bool from_bottom) { 178 void StartPageView::OnContainerSelected(bool from_bottom) {
179 } 179 }
180 180
181 gfx::Rect StartPageView::GetSearchBoxBounds() const { 181 gfx::Rect StartPageView::GetSearchBoxBounds() const {
182 return search_box_spacer_view_->bounds(); 182 return search_box_spacer_view_->bounds();
183 } 183 }
184 184
185 int StartPageView::Update() { 185 int StartPageView::Update() {
186 std::vector<SearchResult*> display_results = 186 std::vector<SearchResult*> display_results =
187 AppListModel::FilterSearchResultsByDisplayType( 187 AppListModel::FilterSearchResultsByDisplayType(
188 results(), SearchResult::DISPLAY_TILE, kNumStartPageTiles); 188 results(), SearchResult::DISPLAY_RECOMMENDATION, kNumStartPageTiles);
189 189
190 // Update the tile item results. 190 // Update the tile item results.
191 for (size_t i = 0; i < search_result_tile_views_.size(); ++i) { 191 for (size_t i = 0; i < search_result_tile_views_.size(); ++i) {
192 SearchResult* item = NULL; 192 SearchResult* item = NULL;
193 if (i < display_results.size()) 193 if (i < display_results.size())
194 item = display_results[i]; 194 item = display_results[i];
195 search_result_tile_views_[i]->SetSearchResult(item); 195 search_result_tile_views_[i]->SetSearchResult(item);
196 } 196 }
197 197
198 tiles_container_->Layout(); 198 tiles_container_->Layout();
199 Layout(); 199 Layout();
200 return display_results.size(); 200 return display_results.size();
201 } 201 }
202 202
203 void StartPageView::UpdateSelectedIndex(int old_selected, int new_selected) { 203 void StartPageView::UpdateSelectedIndex(int old_selected, int new_selected) {
204 } 204 }
205 205
206 } // namespace app_list 206 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/app_list_view_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698