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

Unified Diff: chrome/browser/ui/app_list/search/app_search_provider.cc

Issue 954363002: Fix sort order of unlaunched apps on app list start page. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_start_page_context_and_logs
Patch Set: Created 5 years, 10 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/search/app_search_provider.cc
diff --git a/chrome/browser/ui/app_list/search/app_search_provider.cc b/chrome/browser/ui/app_list/search/app_search_provider.cc
index b81afa693e3c73a6c31565274c3f14b41eee3799..f5307d56baa29c0acad2bd9a474f734f1f75c29a 100644
--- a/chrome/browser/ui/app_list/search/app_search_provider.cc
+++ b/chrome/browser/ui/app_list/search/app_search_provider.cc
@@ -112,9 +112,15 @@ void AppSearchProvider::UpdateResults() {
// Use the app list order to tiebreak apps that have never been launched.
if (app->last_launch_time().is_null()) {
+ auto it = id_to_app_list_index.find(app->app_id());
+ size_t app_list_index =
Matt Giuca 2015/02/27 06:03:53 // If it's in a folder, it won't be in |id_to_app_
calamity 2015/03/02 00:50:52 Done.
+ it == id_to_app_list_index.end() ? apps_.size() : (*it).second;
+ if (app_list_index > apps_.size())
+ app_list_index = apps_.size();
+
result->set_relevance(
kUnlaunchedAppRelevanceStepSize *
- (apps_.size() - id_to_app_list_index[app->app_id()]));
+ (apps_.size() - app_list_index));
} else {
result->UpdateFromLastLaunched(clock_->Now(), app->last_launch_time());
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698