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

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

Issue 2609843004: Fix the Crash in the launcher's start page (a better approach). (Closed)
Patch Set: Created 3 years, 11 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/search_result_list_view.h" 5 #include "ui/app_list/views/search_result_list_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/bind.h" 10 #include "base/bind.h"
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 146
147 void SearchResultListView::NotifyFirstResultYIndex(int y_index) { 147 void SearchResultListView::NotifyFirstResultYIndex(int y_index) {
148 for (size_t i = 0; i < static_cast<size_t>(num_results()); ++i) 148 for (size_t i = 0; i < static_cast<size_t>(num_results()); ++i)
149 GetResultViewAt(i)->result()->set_distance_from_origin(i + y_index); 149 GetResultViewAt(i)->result()->set_distance_from_origin(i + y_index);
150 } 150 }
151 151
152 int SearchResultListView::GetYSize() { 152 int SearchResultListView::GetYSize() {
153 return num_results(); 153 return num_results();
154 } 154 }
155 155
156 int SearchResultListView::Update() { 156 int SearchResultListView::DoUpdate() {
157 std::vector<SearchResult*> display_results = 157 std::vector<SearchResult*> display_results =
158 AppListModel::FilterSearchResultsByDisplayType( 158 AppListModel::FilterSearchResultsByDisplayType(
159 results(), 159 results(),
160 SearchResult::DISPLAY_LIST, 160 SearchResult::DISPLAY_LIST,
161 results_container_->child_count()); 161 results_container_->child_count());
162 162
163 for (size_t i = 0; i < static_cast<size_t>(results_container_->child_count()); 163 for (size_t i = 0; i < static_cast<size_t>(results_container_->child_count());
164 ++i) { 164 ++i) {
165 SearchResultView* result_view = GetResultViewAt(i); 165 SearchResultView* result_view = GetResultViewAt(i);
166 result_view->set_is_last_result(i == display_results.size() - 1); 166 result_view->set_is_last_result(i == display_results.size() - 1);
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 view->result(), action_index, event_flags); 257 view->result(), action_index, event_flags);
258 } 258 }
259 } 259 }
260 260
261 void SearchResultListView::OnSearchResultInstalled(SearchResultView* view) { 261 void SearchResultListView::OnSearchResultInstalled(SearchResultView* view) {
262 if (delegate_ && view->result()) 262 if (delegate_ && view->result())
263 delegate_->OnResultInstalled(view->result()); 263 delegate_->OnResultInstalled(view->result());
264 } 264 }
265 265
266 } // namespace app_list 266 } // namespace app_list
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698