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

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

Issue 1132943004: Add Apps.AppListSearchResultDistanceFromOrigin UMA stat. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_query_length_stat
Patch Set: Created 5 years, 7 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 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 } 137 }
138 138
139 void SearchResultListView::OnContainerSelected(bool from_bottom, 139 void SearchResultListView::OnContainerSelected(bool from_bottom,
140 bool /*directional_movement*/) { 140 bool /*directional_movement*/) {
141 if (num_results() == 0) 141 if (num_results() == 0)
142 return; 142 return;
143 143
144 SetSelectedIndex(from_bottom ? num_results() - 1 : 0); 144 SetSelectedIndex(from_bottom ? num_results() - 1 : 0);
145 } 145 }
146 146
147 void SearchResultListView::NotifyFirstResultYIndex(int y_index) {
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);
150 }
151
152 int SearchResultListView::GetYSize() {
153 return num_results();
154 }
155
147 int SearchResultListView::Update() { 156 int SearchResultListView::Update() {
148 std::vector<SearchResult*> display_results = 157 std::vector<SearchResult*> display_results =
149 AppListModel::FilterSearchResultsByDisplayType( 158 AppListModel::FilterSearchResultsByDisplayType(
150 results(), 159 results(),
151 SearchResult::DISPLAY_LIST, 160 SearchResult::DISPLAY_LIST,
152 results_container_->child_count()); 161 results_container_->child_count());
153 162
154 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());
155 ++i) { 164 ++i) {
156 SearchResultView* result_view = GetResultViewAt(i); 165 SearchResultView* result_view = GetResultViewAt(i);
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
248 view->result(), action_index, event_flags); 257 view->result(), action_index, event_flags);
249 } 258 }
250 } 259 }
251 260
252 void SearchResultListView::OnSearchResultInstalled(SearchResultView* view) { 261 void SearchResultListView::OnSearchResultInstalled(SearchResultView* view) {
253 if (delegate_ && view->result()) 262 if (delegate_ && view->result())
254 delegate_->OnResultInstalled(view->result()); 263 delegate_->OnResultInstalled(view->result());
255 } 264 }
256 265
257 } // namespace app_list 266 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/search_result_list_view.h ('k') | ui/app_list/views/search_result_page_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698