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

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

Issue 2609843004: Fix the Crash in the launcher's start page (a better approach). (Closed)
Patch Set: Rebase. Created 3 years, 11 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_tile_item_list_view.cc ('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..fb1977727114d4635b65d19977d4974c73262f09 100644
--- a/ui/app_list/views/start_page_view.cc
+++ b/ui/app_list/views/start_page_view.cc
@@ -126,7 +126,7 @@ class StartPageView::StartPageTilesContainer
AllAppsTileItemView* all_apps_button() { return all_apps_button_; }
// Overridden from SearchResultContainerView:
- int Update() override;
+ int DoUpdate() override;
void UpdateSelectedIndex(int old_selected, int new_selected) override;
void OnContainerSelected(bool from_bottom,
bool directional_movement) override;
@@ -171,7 +171,7 @@ TileItemView* StartPageView::StartPageTilesContainer::GetTileItemView(
return search_result_tile_views_[index];
}
-int StartPageView::StartPageTilesContainer::Update() {
+int StartPageView::StartPageTilesContainer::DoUpdate() {
// Ignore updates and disable buttons when transitioning to a different
// state.
if (contents_view_->GetActiveState() != AppListModel::STATE_START) {
@@ -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_->Update();
custom_launcher_page_background_->SetSelected(false);
}
« no previous file with comments | « ui/app_list/views/search_result_tile_item_list_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698