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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 | 68 |
69 class Group; | 69 class Group; |
70 typedef ScopedVector<Group> Groups; | 70 typedef ScopedVector<Group> Groups; |
71 | 71 |
72 // Publishes the given |new_results| to |ui_results|, deleting any existing | 72 // Publishes the given |new_results| to |ui_results|, deleting any existing |
73 // results that are not in |new_results|. Results that already exist in | 73 // results that are not in |new_results|. Results that already exist in |
74 // |ui_results| are reused to avoid flickering caused by icon reload. | 74 // |ui_results| are reused to avoid flickering caused by icon reload. |
75 static void Publish(const SortedResults& results, | 75 static void Publish(const SortedResults& results, |
76 AppListModel::SearchResults* ui_results); | 76 AppListModel::SearchResults* ui_results); |
77 | 77 |
78 // Removes duplicates from |results|. | 78 // Removes entries from |results| with duplicate IDs. When two or more results |
| 79 // have the same ID, the earliest one in the |results| list is kept. |
| 80 // NOTE: This is not necessarily the one with the highest *score*, as |
| 81 // |results| may not have been sorted yet. |
79 static void RemoveDuplicates(SortedResults* results); | 82 static void RemoveDuplicates(SortedResults* results); |
80 | 83 |
81 void FetchResults(bool is_voice_query, const KnownResults& known_results); | 84 void FetchResults(bool is_voice_query, const KnownResults& known_results); |
82 | 85 |
83 AppListModel::SearchResults* ui_results_; // Not owned. | 86 AppListModel::SearchResults* ui_results_; // Not owned. |
84 Groups groups_; | 87 Groups groups_; |
85 | 88 |
86 // The ID of the omnibox group. The group with this ID will be treated | 89 // The ID of the omnibox group. The group with this ID will be treated |
87 // specially by the Mixer. | 90 // specially by the Mixer. |
88 // TODO(mgiuca): Omnibox group should not be treated specially. | 91 // TODO(mgiuca): Omnibox group should not be treated specially. |
89 size_t omnibox_group_ = 0; | 92 size_t omnibox_group_ = 0; |
90 // Whether |omnibox_group_| has been set. | 93 // Whether |omnibox_group_| has been set. |
91 bool has_omnibox_group_ = false; | 94 bool has_omnibox_group_ = false; |
92 | 95 |
93 DISALLOW_COPY_AND_ASSIGN(Mixer); | 96 DISALLOW_COPY_AND_ASSIGN(Mixer); |
94 }; | 97 }; |
95 | 98 |
96 } // namespace app_list | 99 } // namespace app_list |
97 | 100 |
98 #endif // UI_APP_LIST_SEARCH_MIXER_H_ | 101 #endif // UI_APP_LIST_SEARCH_MIXER_H_ |
OLD | NEW |