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

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

Issue 922063003: Sort experimental app list search result groups. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@fix_search_results_not_being_there
Patch Set: force test to be experimental app list Created 5 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
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 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 if (i < display_results.size()) { 156 if (i < display_results.size()) {
157 result_view->SetResult(display_results[i]); 157 result_view->SetResult(display_results[i]);
158 result_view->SetVisible(true); 158 result_view->SetVisible(true);
159 } else { 159 } else {
160 result_view->SetResult(NULL); 160 result_view->SetResult(NULL);
161 result_view->SetVisible(false); 161 result_view->SetVisible(false);
162 } 162 }
163 } 163 }
164 UpdateAutoLaunchState(); 164 UpdateAutoLaunchState();
165 165
166 set_container_score(
167 display_results.empty() ? 0 : display_results.front()->relevance());
168
166 return display_results.size(); 169 return display_results.size();
167 } 170 }
168 171
169 void SearchResultListView::UpdateSelectedIndex(int old_selected, 172 void SearchResultListView::UpdateSelectedIndex(int old_selected,
170 int new_selected) { 173 int new_selected) {
171 if (old_selected >= 0) { 174 if (old_selected >= 0) {
172 SearchResultView* selected_view = GetResultViewAt(old_selected); 175 SearchResultView* selected_view = GetResultViewAt(old_selected);
173 selected_view->ClearSelectedAction(); 176 selected_view->ClearSelectedAction();
174 selected_view->SchedulePaint(); 177 selected_view->SchedulePaint();
175 } 178 }
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 view->result(), action_index, event_flags); 246 view->result(), action_index, event_flags);
244 } 247 }
245 } 248 }
246 249
247 void SearchResultListView::OnSearchResultInstalled(SearchResultView* view) { 250 void SearchResultListView::OnSearchResultInstalled(SearchResultView* view) {
248 if (delegate_ && view->result()) 251 if (delegate_ && view->result())
249 delegate_->OnResultInstalled(view->result()); 252 delegate_->OnResultInstalled(view->result());
250 } 253 }
251 254
252 } // namespace app_list 255 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/search_result_container_view.h ('k') | ui/app_list/views/search_result_list_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698