| 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 "ui/app_list/app_list_model.h" | 11 #include "ui/app_list/app_list_model.h" |
| 11 | 12 |
| 12 namespace app_list { | 13 namespace app_list { |
| 13 | 14 |
| 14 class SearchProvider; | 15 class SearchProvider; |
| 15 | 16 |
| 16 // Mixer collects results from providers, sorts them and publishes them to the | 17 // Mixer collects results from providers, sorts them and publishes them to the |
| 17 // SearchResults UI model. The targeted results have 6 slots to hold the | 18 // SearchResults UI model. The targeted results have 6 slots to hold the |
| 18 // result. These slots could be viewed as having three groups: main group | 19 // result. These slots could be viewed as having three groups: main group |
| 19 // (local apps and contacts), omnibox group and web store group. The | 20 // (local apps and contacts), omnibox group and web store group. The |
| (...skipping 12 matching lines...) Expand all Loading... |
| 32 explicit Mixer(AppListModel::SearchResults* ui_results); | 33 explicit Mixer(AppListModel::SearchResults* ui_results); |
| 33 ~Mixer(); | 34 ~Mixer(); |
| 34 | 35 |
| 35 // Creates mixer groups. | 36 // Creates mixer groups. |
| 36 void Init(); | 37 void Init(); |
| 37 | 38 |
| 38 // Associates a provider with a mixer group. | 39 // Associates a provider with a mixer group. |
| 39 void AddProviderToGroup(GroupId group, SearchProvider* provider); | 40 void AddProviderToGroup(GroupId group, SearchProvider* provider); |
| 40 | 41 |
| 41 // Collects the results, sorts and publishes them. | 42 // Collects the results, sorts and publishes them. |
| 42 void MixAndPublish(); | 43 void MixAndPublish(const KnownResults& known_results); |
| 43 | 44 |
| 44 private: | 45 private: |
| 45 class Group; | 46 class Group; |
| 46 typedef ScopedVector<Group> Groups; | 47 typedef ScopedVector<Group> Groups; |
| 47 | 48 |
| 48 void FetchResults(); | 49 void FetchResults(const KnownResults& known_results); |
| 49 | 50 |
| 50 AppListModel::SearchResults* ui_results_; // Not owned. | 51 AppListModel::SearchResults* ui_results_; // Not owned. |
| 51 Groups groups_; | 52 Groups groups_; |
| 52 | 53 |
| 53 DISALLOW_COPY_AND_ASSIGN(Mixer); | 54 DISALLOW_COPY_AND_ASSIGN(Mixer); |
| 54 }; | 55 }; |
| 55 | 56 |
| 56 } // namespace app_list | 57 } // namespace app_list |
| 57 | 58 |
| 58 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_MIXER_H_ | 59 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_MIXER_H_ |
| OLD | NEW |