| 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 26 matching lines...) Expand all Loading... |
| 37 // Adds a new mixer group. A "soft" maximum of |max_results| results will be | 37 // Adds a new mixer group. A "soft" maximum of |max_results| results will be |
| 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. If |is_empty_query| equals |
| 48 void MixAndPublish(bool is_voice_query, const KnownResults& known_results); | 48 // true, the results are to be shown on the launcher start page. |
| 49 void MixAndPublish(bool is_empty_query, |
| 50 bool is_voice_query, |
| 51 const KnownResults& known_results); |
| 49 | 52 |
| 50 private: | 53 private: |
| 51 FRIEND_TEST_ALL_PREFIXES(test::MixerTest, Publish); | 54 FRIEND_TEST_ALL_PREFIXES(test::MixerTest, Publish); |
| 52 | 55 |
| 53 // Used for sorting and mixing results. | 56 // Used for sorting and mixing results. |
| 54 struct APP_LIST_EXPORT SortData { | 57 struct APP_LIST_EXPORT SortData { |
| 55 SortData(); | 58 SortData(); |
| 56 SortData(SearchResult* result, double score); | 59 SortData(SearchResult* result, double score); |
| 57 | 60 |
| 58 bool operator<(const SortData& other) const; | 61 bool operator<(const SortData& other) const; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 81 | 84 |
| 82 AppListModel::SearchResults* ui_results_; // Not owned. | 85 AppListModel::SearchResults* ui_results_; // Not owned. |
| 83 Groups groups_; | 86 Groups groups_; |
| 84 | 87 |
| 85 DISALLOW_COPY_AND_ASSIGN(Mixer); | 88 DISALLOW_COPY_AND_ASSIGN(Mixer); |
| 86 }; | 89 }; |
| 87 | 90 |
| 88 } // namespace app_list | 91 } // namespace app_list |
| 89 | 92 |
| 90 #endif // UI_APP_LIST_SEARCH_MIXER_H_ | 93 #endif // UI_APP_LIST_SEARCH_MIXER_H_ |
| OLD | NEW |