Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/search/mixer.h" | 5 #include "ui/app_list/search/mixer.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/macros.h" | 13 #include "base/macros.h" |
| 14 #include "ui/app_list/search_provider.h" | 14 #include "ui/app_list/search_provider.h" |
| 15 #include "ui/app_list/search_result.h" | 15 #include "ui/app_list/search_result.h" |
| 16 | 16 |
| 17 namespace app_list { | 17 namespace app_list { |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 | 20 |
| 21 // Maximum number of results to show. | 21 // Maximum number of results to show. |
| 22 const size_t kMinResults = 6; | 22 const size_t kMinResults = 9; |
|
xiyuan
2016/08/08 18:02:15
Would this change the search result UI? That is, t
xdai1
2016/08/08 21:25:38
No it doesn't change the search result UI. The num
xdai1
2016/08/08 21:30:08
kNumSearchResultTiles (https://cs.chromium.org/chr
xiyuan
2016/08/08 21:41:00
The mixer is applying weight and sort the results
| |
| 23 | 23 |
| 24 void UpdateResult(const SearchResult& source, SearchResult* target) { | 24 void UpdateResult(const SearchResult& source, SearchResult* target) { |
| 25 target->set_display_type(source.display_type()); | 25 target->set_display_type(source.display_type()); |
| 26 target->set_title(source.title()); | 26 target->set_title(source.title()); |
| 27 target->set_title_tags(source.title_tags()); | 27 target->set_title_tags(source.title_tags()); |
| 28 target->set_details(source.details()); | 28 target->set_details(source.details()); |
| 29 target->set_details_tags(source.details_tags()); | 29 target->set_details_tags(source.details_tags()); |
| 30 } | 30 } |
| 31 | 31 |
| 32 } // namespace | 32 } // namespace |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 248 results->swap(final); | 248 results->swap(final); |
| 249 } | 249 } |
| 250 | 250 |
| 251 void Mixer::FetchResults(bool is_voice_query, | 251 void Mixer::FetchResults(bool is_voice_query, |
| 252 const KnownResults& known_results) { | 252 const KnownResults& known_results) { |
| 253 for (auto* group : groups_) | 253 for (auto* group : groups_) |
| 254 group->FetchResults(is_voice_query, known_results); | 254 group->FetchResults(is_voice_query, known_results); |
| 255 } | 255 } |
| 256 | 256 |
| 257 } // namespace app_list | 257 } // namespace app_list |
| OLD | NEW |