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

Unified Diff: ui/app_list/app_list_model.cc

Issue 1003393002: After uninstall, remove last item in Launcher folder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: ui/app_list/app_list_model.cc
diff --git a/ui/app_list/app_list_model.cc b/ui/app_list/app_list_model.cc
index 0a8e0cd33bfc5b8b006eb65fd62d4dbaf375cb41..4c4d9b0d1f9ccc4ad8d82366302fb11b01fbdd54 100644
--- a/ui/app_list/app_list_model.cc
+++ b/ui/app_list/app_list_model.cc
@@ -219,6 +219,19 @@ bool AppListModel::MoveItemToFolderAt(AppListItem* item,
return true;
}
+void AppListModel::DeleteUninstalledItem(const std::string& id) {
+ AppListItem* item = FindItem(id);
+ if (!item)
+ return;
+ AppListFolderItem* folder = FindFolderItem(item->folder_id());
+ DeleteItem(id);
+
+ if (folder) {
+ FOR_EACH_OBSERVER(AppListModelObserver, observers_,
+ OnAppListChildItemUninstalled(folder));
+ }
+}
+
void AppListModel::SetItemPosition(AppListItem* item,
const syncer::StringOrdinal& new_position) {
if (!item->IsInFolder()) {

Powered by Google App Engine
This is Rietveld 408576698