Chromium Code Reviews| Index: chrome/browser/ui/app_list/search/mixer.h |
| diff --git a/chrome/browser/ui/app_list/search/mixer.h b/chrome/browser/ui/app_list/search/mixer.h |
| index b195d6371a842ff4ba2d554ee6a3f19aa4713845..f47c2d923866c7afe393266a0d0325dd4c2fd95a 100644 |
| --- a/chrome/browser/ui/app_list/search/mixer.h |
| +++ b/chrome/browser/ui/app_list/search/mixer.h |
| @@ -12,6 +12,7 @@ |
| namespace app_list { |
| +class ChromeSearchResult; |
| class SearchProvider; |
| // Mixer collects results from providers, sorts them and publishes them to the |
| @@ -22,6 +23,17 @@ class SearchProvider; |
| // slots. The omnibox group takes all the remaining slots. |
| class Mixer { |
| public: |
| + // Used for sorting and mixing results. |
| + struct SortData { |
| + SortData(); |
| + SortData(ChromeSearchResult* result, double score); |
| + |
| + bool operator<(const SortData& other) const; |
| + |
| + ChromeSearchResult* result; // Not owned. |
| + double score; |
| + }; |
| + |
| // The enum represents mixer groups. Note this must matches the order |
| // of group creation in Init(). |
| enum GroupId { |
| @@ -43,6 +55,11 @@ class Mixer { |
| // Collects the results, sorts and publishes them. |
| void MixAndPublish(const KnownResults& known_results); |
| + // Publishes the given |results| to |ui_results|. Reuse existing ones to avoid |
| + // flickering. |
| + static void Publish(const std::vector<SortData>& results, |
|
Matt Giuca
2014/07/08 01:48:23
I think the standard practice here would be to mak
calamity
2014/07/08 04:23:00
Done-ish. SortData still needs to be public to be
Matt Giuca
2014/07/08 05:31:45
Use FRIEND_TEST_ALL_PREFIXES to actually friend th
|
| + AppListModel::SearchResults* ui_results); |
| + |
| private: |
| class Group; |
| typedef ScopedVector<Group> Groups; |