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

Unified Diff: ui/app_list/apps_grid_view.cc

Issue 10892017: app_list: Fix crash after uninstalling last app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add test Created 8 years, 4 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/apps_grid_view.h ('k') | ui/app_list/apps_grid_view_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/apps_grid_view.cc
diff --git a/ui/app_list/apps_grid_view.cc b/ui/app_list/apps_grid_view.cc
index 33b5ac0c54a2d2eebd29e84d543b80b681f063da..3895bf6b8b3a32ef074778ec19cd7af420ad1974 100644
--- a/ui/app_list/apps_grid_view.cc
+++ b/ui/app_list/apps_grid_view.cc
@@ -237,6 +237,18 @@ void AppsGridView::OnPaintFocusBorder(gfx::Canvas* canvas) {
// Override to not paint focus frame.
}
+void AppsGridView::ViewHierarchyChanged(bool is_add,
+ views::View* parent,
+ views::View* child) {
+ if (!is_add) {
+ if (parent == this &&
+ selected_item_index_ >= 0 &&
+ GetItemViewAtIndex(selected_item_index_) == child) {
+ selected_item_index_ = -1;
+ }
+ }
+}
+
void AppsGridView::Update() {
selected_item_index_ = -1;
RemoveAllChildViews(true);
« no previous file with comments | « ui/app_list/apps_grid_view.h ('k') | ui/app_list/apps_grid_view_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698