Chromium Code Reviews| Index: ui/app_list/views/search_result_tile_item_list_view.cc |
| diff --git a/ui/app_list/views/search_result_tile_item_list_view.cc b/ui/app_list/views/search_result_tile_item_list_view.cc |
| index ae0cba3d82a04852ee322565c091073b2df8fcc9..4cd156a9042cc5eadcba14d92861343708778a93 100644 |
| --- a/ui/app_list/views/search_result_tile_item_list_view.cc |
| +++ b/ui/app_list/views/search_result_tile_item_list_view.cc |
| @@ -169,7 +169,11 @@ void SearchResultTileItemListView::UpdateSelectedIndex(int old_selected, |
| } |
| bool SearchResultTileItemListView::OnKeyPressed(const ui::KeyEvent& event) { |
| - if (selected_index() >= 0 && child_at(selected_index())->OnKeyPressed(event)) |
| + int selection_index = selected_index(); |
| + // Also count the separator when Play Store app search feature is enabled. |
| + int child_index = is_play_store_app_search_enabled_ ? selection_index * 2 + 1 |
|
khmel
2017/07/18 15:04:01
nit: const int
Jiaquan He
2017/07/18 15:58:16
Done.
|
| + : selection_index; |
| + if (selection_index >= 0 && child_at(child_index)->OnKeyPressed(event)) |
| return true; |
| int dir = 0; |
| @@ -204,7 +208,7 @@ bool SearchResultTileItemListView::OnKeyPressed(const ui::KeyEvent& event) { |
| if (dir == 0) |
| return false; |
| - int selection_index = selected_index() + dir; |
| + selection_index = selection_index + dir; |
| if (IsValidSelectionIndex(selection_index)) { |
| SetSelectedIndex(selection_index); |
| return true; |