| 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 #ifndef UI_APP_LIST_SEARCH_MIXER_H_ | 5 #ifndef UI_APP_LIST_SEARCH_MIXER_H_ |
| 6 #define UI_APP_LIST_SEARCH_MIXER_H_ | 6 #define UI_APP_LIST_SEARCH_MIXER_H_ |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // chosen from this group (if 0, will allow unlimited results from this | 38 // chosen from this group (if 0, will allow unlimited results from this |
| 39 // group). If there aren't enough results from all groups, more than | 39 // group). If there aren't enough results from all groups, more than |
| 40 // |max_results| may be chosen from this group. Each result in the group will | 40 // |max_results| may be chosen from this group. Each result in the group will |
| 41 // have its score multiplied by |multiplier|. Returns the group's group_id. | 41 // have its score multiplied by |multiplier|. Returns the group's group_id. |
| 42 size_t AddGroup(size_t max_results, double multiplier); | 42 size_t AddGroup(size_t max_results, double multiplier); |
| 43 | 43 |
| 44 // Associates a provider with a mixer group. | 44 // Associates a provider with a mixer group. |
| 45 void AddProviderToGroup(size_t group_id, SearchProvider* provider); | 45 void AddProviderToGroup(size_t group_id, SearchProvider* provider); |
| 46 | 46 |
| 47 // Collects the results, sorts and publishes them. | 47 // Collects the results, sorts and publishes them. |
| 48 void MixAndPublish(bool is_voice_query, const KnownResults& known_results); | 48 void MixAndPublish(bool is_voice_query, |
| 49 const KnownResults& known_results, |
| 50 size_t num_max_results); |
| 49 | 51 |
| 50 private: | 52 private: |
| 51 FRIEND_TEST_ALL_PREFIXES(test::MixerTest, Publish); | 53 FRIEND_TEST_ALL_PREFIXES(test::MixerTest, Publish); |
| 52 | 54 |
| 53 // Used for sorting and mixing results. | 55 // Used for sorting and mixing results. |
| 54 struct APP_LIST_EXPORT SortData { | 56 struct APP_LIST_EXPORT SortData { |
| 55 SortData(); | 57 SortData(); |
| 56 SortData(SearchResult* result, double score); | 58 SortData(SearchResult* result, double score); |
| 57 | 59 |
| 58 bool operator<(const SortData& other) const; | 60 bool operator<(const SortData& other) const; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 81 | 83 |
| 82 AppListModel::SearchResults* ui_results_; // Not owned. | 84 AppListModel::SearchResults* ui_results_; // Not owned. |
| 83 Groups groups_; | 85 Groups groups_; |
| 84 | 86 |
| 85 DISALLOW_COPY_AND_ASSIGN(Mixer); | 87 DISALLOW_COPY_AND_ASSIGN(Mixer); |
| 86 }; | 88 }; |
| 87 | 89 |
| 88 } // namespace app_list | 90 } // namespace app_list |
| 89 | 91 |
| 90 #endif // UI_APP_LIST_SEARCH_MIXER_H_ | 92 #endif // UI_APP_LIST_SEARCH_MIXER_H_ |
| OLD | NEW |