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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_APP_LIST_SEARCH_MIXER_H_
6 #define CHROME_BROWSER_UI_APP_LIST_SEARCH_MIXER_H_
8 #include "base/basictypes.h"
9 #include "base/memory/scoped_vector.h"
10 #include "chrome/browser/ui/app_list/search/history_types.h"
11 #include "ui/app_list/app_list_model.h"
17 // Mixer collects results from providers, sorts them and publishes them to the
18 // SearchResults UI model. The targeted results have 6 slots to hold the
19 // result. These slots could be viewed as having three groups: main group
20 // (local apps and contacts), omnibox group and web store group. The
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.
25 // The enum represents mixer groups. Note this must matches the order
26 // of group creation in Init().
34 explicit Mixer(AppListModel::SearchResults
* ui_results
);
37 // Creates mixer groups.
40 // Associates a provider with a mixer group.
41 void AddProviderToGroup(GroupId group
, SearchProvider
* provider
);
43 // Collects the results, sorts and publishes them.
44 void MixAndPublish(const KnownResults
& known_results
);
48 typedef ScopedVector
<Group
> Groups
;
50 void FetchResults(const KnownResults
& known_results
);
52 AppListModel::SearchResults
* ui_results_
; // Not owned.
55 DISALLOW_COPY_AND_ASSIGN(Mixer
);
58 } // namespace app_list
60 #endif // CHROME_BROWSER_UI_APP_LIST_SEARCH_MIXER_H_