| 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 // Adds a new mixer group for the special "omnibox" group. This group will be | 50 // Adds a new mixer group for the special "omnibox" group. This group will be |
| 51 // treated specially by the Mixer (it will be truncated such that it fills the | 51 // treated specially by the Mixer (it will be truncated such that it fills the |
| 52 // remaining slots without overflowing, but with at least one result). A | 52 // remaining slots without overflowing, but with at least one result). A |
| 53 // maximum of one group should be added using this method. | 53 // maximum of one group should be added using this method. |
| 54 size_t AddOmniboxGroup(size_t max_results, double boost, double multiplier); | 54 size_t AddOmniboxGroup(size_t max_results, double boost, double multiplier); |
| 55 | 55 |
| 56 // Associates a provider with a mixer group. | 56 // Associates a provider with a mixer group. |
| 57 void AddProviderToGroup(size_t group_id, SearchProvider* provider); | 57 void AddProviderToGroup(size_t group_id, SearchProvider* provider); |
| 58 | 58 |
| 59 // Collects the results, sorts and publishes them. | 59 // Collects the results, sorts and publishes them. |
| 60 void MixAndPublish(bool is_voice_query, const KnownResults& known_results); | 60 void MixAndPublish(bool is_voice_query, |
| 61 const KnownResults& known_results, |
| 62 size_t num_max_results); |
| 61 | 63 |
| 62 private: | 64 private: |
| 63 FRIEND_TEST_ALL_PREFIXES(test::MixerTest, Publish); | 65 FRIEND_TEST_ALL_PREFIXES(test::MixerTest, Publish); |
| 64 | 66 |
| 65 // Used for sorting and mixing results. | 67 // Used for sorting and mixing results. |
| 66 struct APP_LIST_EXPORT SortData { | 68 struct APP_LIST_EXPORT SortData { |
| 67 SortData(); | 69 SortData(); |
| 68 SortData(SearchResult* result, double score); | 70 SortData(SearchResult* result, double score); |
| 69 | 71 |
| 70 bool operator<(const SortData& other) const; | 72 bool operator<(const SortData& other) const; |
| (...skipping 30 matching lines...) Expand all Loading... |
| 101 size_t omnibox_group_ = 0; | 103 size_t omnibox_group_ = 0; |
| 102 // Whether |omnibox_group_| has been set. | 104 // Whether |omnibox_group_| has been set. |
| 103 bool has_omnibox_group_ = false; | 105 bool has_omnibox_group_ = false; |
| 104 | 106 |
| 105 DISALLOW_COPY_AND_ASSIGN(Mixer); | 107 DISALLOW_COPY_AND_ASSIGN(Mixer); |
| 106 }; | 108 }; |
| 107 | 109 |
| 108 } // namespace app_list | 110 } // namespace app_list |
| 109 | 111 |
| 110 #endif // UI_APP_LIST_SEARCH_MIXER_H_ | 112 #endif // UI_APP_LIST_SEARCH_MIXER_H_ |
| OLD | NEW |