Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Unified Diff: ui/app_list/app_list_model.cc

Issue 439703002: Allow app list tiles to show search results in the experimental app list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix merge Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/app_list/app_list_model.h ('k') | ui/app_list/search_result.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/app_list_model.cc
diff --git a/ui/app_list/app_list_model.cc b/ui/app_list/app_list_model.cc
index 5714137b3f23ad4c4f92b0e29ab5dd52ed75b1b3..2d0f58f64500196d931c7badf513c7dd7f4a5843 100644
--- a/ui/app_list/app_list_model.cc
+++ b/ui/app_list/app_list_model.cc
@@ -10,7 +10,6 @@
#include "ui/app_list/app_list_item.h"
#include "ui/app_list/app_list_model_observer.h"
#include "ui/app_list/search_box_model.h"
-#include "ui/app_list/search_result.h"
namespace app_list {
@@ -285,6 +284,22 @@ void AppListModel::SetFoldersEnabled(bool folders_enabled) {
DeleteItem(folder_ids[i]);
}
+std::vector<SearchResult*> AppListModel::FilterSearchResultsByDisplayType(
+ SearchResults* results,
+ SearchResult::DisplayType display_type,
+ size_t max_results) {
+ std::vector<SearchResult*> matches;
+ for (size_t i = 0; i < results->item_count(); ++i) {
+ SearchResult* item = results->GetItemAt(i);
+ if (item->display_type() == display_type) {
+ matches.push_back(item);
+ if (matches.size() == max_results)
+ break;
+ }
+ }
+ return matches;
+}
+
// Private methods
void AppListModel::OnListItemMoved(size_t from_index,
« no previous file with comments | « ui/app_list/app_list_model.h ('k') | ui/app_list/search_result.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698