Chromium Code Reviews| 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()); |
| } |