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> |
(...skipping 10 matching lines...) Expand all Loading... |
21 const size_t kMaxResults = 6; | 21 const size_t kMaxResults = 6; |
22 const size_t kMaxMainGroupResults = 4; | 22 const size_t kMaxMainGroupResults = 4; |
23 const size_t kMaxWebstoreResults = 2; | 23 const size_t kMaxWebstoreResults = 2; |
24 const size_t kMaxPeopleResults = 2; | 24 const size_t kMaxPeopleResults = 2; |
25 const size_t kMaxSuggestionsResults = 6; | 25 const size_t kMaxSuggestionsResults = 6; |
26 | 26 |
27 // A value to indicate no max number of results limit. | 27 // A value to indicate no max number of results limit. |
28 const size_t kNoMaxResultsLimit = 0; | 28 const size_t kNoMaxResultsLimit = 0; |
29 | 29 |
30 void UpdateResult(const SearchResult& source, SearchResult* target) { | 30 void UpdateResult(const SearchResult& source, SearchResult* target) { |
| 31 target->set_display_type(source.display_type()); |
31 target->set_title(source.title()); | 32 target->set_title(source.title()); |
32 target->set_title_tags(source.title_tags()); | 33 target->set_title_tags(source.title_tags()); |
33 target->set_details(source.details()); | 34 target->set_details(source.details()); |
34 target->set_details_tags(source.details_tags()); | 35 target->set_details_tags(source.details_tags()); |
35 } | 36 } |
36 | 37 |
37 } // namespace | 38 } // namespace |
38 | 39 |
39 Mixer::SortData::SortData() : result(NULL), score(0.0) { | 40 Mixer::SortData::SortData() : result(NULL), score(0.0) { |
40 } | 41 } |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 results->swap(final); | 253 results->swap(final); |
253 } | 254 } |
254 | 255 |
255 void Mixer::FetchResults(bool is_voice_query, | 256 void Mixer::FetchResults(bool is_voice_query, |
256 const KnownResults& known_results) { | 257 const KnownResults& known_results) { |
257 for (const auto& item : groups_) | 258 for (const auto& item : groups_) |
258 item.second->FetchResults(is_voice_query, known_results); | 259 item.second->FetchResults(is_voice_query, known_results); |
259 } | 260 } |
260 | 261 |
261 } // namespace app_list | 262 } // namespace app_list |
OLD | NEW |