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

Unified Diff: ui/app_list/views/start_page_view.cc

Issue 2605463003: Fix the Crash in the launcher's start page on Chrome OS. (Closed)
Patch Set: nit fix. Created 3 years, 12 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/views/search_result_container_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/start_page_view.cc
diff --git a/ui/app_list/views/start_page_view.cc b/ui/app_list/views/start_page_view.cc
index 0bac15b7b2ab6f8edd0963a7683af447347acb52..8df6a7a3d0ba7ed94ab74f39f54d75190fb7a4c6 100644
--- a/ui/app_list/views/start_page_view.cc
+++ b/ui/app_list/views/start_page_view.cc
@@ -190,7 +190,7 @@ int StartPageView::StartPageTilesContainer::Update() {
delete search_result_tile_views_[i];
search_result_tile_views_.clear();
RemoveChildView(all_apps_button_);
- CreateAppsGrid(std::min(kNumStartPageTiles, display_results.size()));
+ CreateAppsGrid(display_results.size());
}
// Update the tile item results.
@@ -211,10 +211,10 @@ int StartPageView::StartPageTilesContainer::Update() {
void StartPageView::StartPageTilesContainer::UpdateSelectedIndex(
int old_selected,
int new_selected) {
- if (old_selected >= 0)
+ if (old_selected >= 0 && old_selected < num_results())
GetTileItemView(old_selected)->SetSelected(false);
- if (new_selected >= 0)
+ if (new_selected >= 0 && new_selected < num_results())
GetTileItemView(new_selected)->SetSelected(true);
}
@@ -360,8 +360,8 @@ void StartPageView::OnShown() {
custom_page_view->SetVisible(
app_list_main_view_->ShouldShowCustomLauncherPage());
}
- tiles_container_->Update();
tiles_container_->ClearSelectedIndex();
+ tiles_container_->set_num_results(tiles_container_->Update());
custom_launcher_page_background_->SetSelected(false);
}
« no previous file with comments | « ui/app_list/views/search_result_container_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698