Chromium Code Reviews| Index: ui/app_list/views/app_list_main_view.cc |
| diff --git a/ui/app_list/views/app_list_main_view.cc b/ui/app_list/views/app_list_main_view.cc |
| index dceae0faa72d4f49bddc4e827b990d5bc0c64783..ddc0b183ee4a8a36e80f0175abd6a6c926676b99 100644 |
| --- a/ui/app_list/views/app_list_main_view.cc |
| +++ b/ui/app_list/views/app_list_main_view.cc |
| @@ -266,6 +266,26 @@ void AppListMainView::UpdateCustomLauncherPageVisibility() { |
| } |
| } |
| +// Issue 368111: Upon uninstall of 2nd-to-last folder item, reparent last child |
| +// to top and remove folder. |
| +void AppListMainView::OnAppListChildItemUninstalled(AppListFolderItem* parent) { |
| + if (!parent || parent->ChildItemCount() != 1u) |
| + return; |
| + |
| + AppsGridView* top_grid_view = |
| + contents_view_->apps_container_view()->apps_grid_view(); |
| + AppsGridView* folder_grid_view = contents_view_->apps_container_view() |
| + ->app_list_folder_view() |
| + ->items_grid_view(); |
| + |
| + model_->top_level_item_list()->RemoveObserver(top_grid_view); |
| + folder_grid_view->SetItemList(nullptr); // removes observer |
| + |
| + top_grid_view->RemoveLastItemFromReparentItemFolderIfNecessary(parent->id()); |
| + |
| + model_->top_level_item_list()->AddObserver(top_grid_view); |
| +} |
| + |
|
Greg Levin
2015/03/14 03:51:45
When "drag app out of folder" uses RemoveLastItemF
jennyz
2015/03/17 21:16:48
Yes, the views are the observers of its associated
Greg Levin
2015/03/23 22:04:50
Ok, that makes sense. Thanks!
|
| void AppListMainView::OnCustomLauncherPageEnabledStateChanged(bool enabled) { |
| views::View* custom_page = contents_view_->custom_page_view(); |
| if (!custom_page) |