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

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

Issue 1003393002: After uninstall, remove last item in Launcher folder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Another round of revisions Created 5 years, 9 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
« ui/app_list/app_list_model.cc ('K') | « ui/app_list/views/app_list_main_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/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..852d480a6c9b5b1e3c811fc91379099f1cc2c5bd 100644
--- a/ui/app_list/views/app_list_main_view.cc
+++ b/ui/app_list/views/app_list_main_view.cc
@@ -266,6 +266,22 @@ void AppListMainView::UpdateCustomLauncherPageVisibility() {
}
}
+// If |folder_id| is open, this will remove AppItemList from the folder's
+// AppsGridView before the folder is deleted.
+void AppListMainView::OnSingleItemFolderWillBeDeleted(
+ const std::string& folder_id) {
+ AppListFolderView* folder_view =
+ contents_view_->apps_container_view()->app_list_folder_view();
+ AppListFolderItem* open_folder_item = folder_view->folder_item();
+
+ if (open_folder_item && open_folder_item->id() == folder_id &&
+ contents_view_->apps_container_view()->IsInFolderView()) {
+ AppsGridView* folder_grid_view = folder_view->items_grid_view();
+ if (folder_grid_view)
+ folder_grid_view->SetItemList(nullptr); // removes observer
+ }
+}
+
void AppListMainView::OnCustomLauncherPageEnabledStateChanged(bool enabled) {
views::View* custom_page = contents_view_->custom_page_view();
if (!custom_page)
« ui/app_list/app_list_model.cc ('K') | « ui/app_list/views/app_list_main_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698