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 CHROME_BROWSER_UI_APP_LIST_SEARCH_MIXER_H_ | 5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_MIXER_H_ |
6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_MIXER_H_ | 6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_MIXER_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "chrome/browser/ui/app_list/search/history_types.h" | 10 #include "chrome/browser/ui/app_list/search/history_types.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 // main group takes no more than 4 slots. The web store takes no more than 2 | 21 // main group takes no more than 4 slots. The web store takes no more than 2 |
22 // slots. The omnibox group takes all the remaining slots. | 22 // slots. The omnibox group takes all the remaining slots. |
23 class Mixer { | 23 class Mixer { |
24 public: | 24 public: |
25 // The enum represents mixer groups. Note this must matches the order | 25 // The enum represents mixer groups. Note this must matches the order |
26 // of group creation in Init(). | 26 // of group creation in Init(). |
27 enum GroupId { | 27 enum GroupId { |
28 MAIN_GROUP = 0, | 28 MAIN_GROUP = 0, |
29 OMNIBOX_GROUP = 1, | 29 OMNIBOX_GROUP = 1, |
30 WEBSTORE_GROUP = 2, | 30 WEBSTORE_GROUP = 2, |
| 31 PEOPLE_GROUP = 3, |
31 }; | 32 }; |
32 | 33 |
33 explicit Mixer(AppListModel::SearchResults* ui_results); | 34 explicit Mixer(AppListModel::SearchResults* ui_results); |
34 ~Mixer(); | 35 ~Mixer(); |
35 | 36 |
36 // Creates mixer groups. | 37 // Creates mixer groups. |
37 void Init(); | 38 void Init(); |
38 | 39 |
39 // Associates a provider with a mixer group. | 40 // Associates a provider with a mixer group. |
40 void AddProviderToGroup(GroupId group, SearchProvider* provider); | 41 void AddProviderToGroup(GroupId group, SearchProvider* provider); |
41 | 42 |
42 // Collects the results, sorts and publishes them. | 43 // Collects the results, sorts and publishes them. |
43 void MixAndPublish(const KnownResults& known_results); | 44 void MixAndPublish(const KnownResults& known_results); |
44 | 45 |
45 private: | 46 private: |
46 class Group; | 47 class Group; |
47 typedef ScopedVector<Group> Groups; | 48 typedef ScopedVector<Group> Groups; |
48 | 49 |
49 void FetchResults(const KnownResults& known_results); | 50 void FetchResults(const KnownResults& known_results); |
50 | 51 |
51 AppListModel::SearchResults* ui_results_; // Not owned. | 52 AppListModel::SearchResults* ui_results_; // Not owned. |
52 Groups groups_; | 53 Groups groups_; |
53 | 54 |
54 DISALLOW_COPY_AND_ASSIGN(Mixer); | 55 DISALLOW_COPY_AND_ASSIGN(Mixer); |
55 }; | 56 }; |
56 | 57 |
57 } // namespace app_list | 58 } // namespace app_list |
58 | 59 |
59 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_MIXER_H_ | 60 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_MIXER_H_ |
OLD | NEW |