| 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..48394478d48db0605cafddc3bcadcc3e82c3acdf 100644
|
| --- a/ui/app_list/app_list_model.cc
|
| +++ b/ui/app_list/app_list_model.cc
|
| @@ -280,6 +280,22 @@ void AppListModel::DeleteItem(const std::string& id) {
|
| FOR_EACH_OBSERVER(AppListModelObserver, observers_, OnAppListItemDeleted());
|
| }
|
|
|
| +void AppListModel::DeleteUninstalledItem(const std::string& id) {
|
| + AppListItem* item = FindItem(id);
|
| + if (!item)
|
| + return;
|
| + const std::string folder_id = item->folder_id();
|
| + DeleteItem(id);
|
| +
|
| + // crbug.com/368111: Upon uninstall of 2nd-to-last folder item, reparent last
|
| + // item to top; this will remove the folder.
|
| + AppListFolderItem* folder = FindFolderItem(folder_id);
|
| + if (folder && folder->ChildItemCount() == 1u) {
|
| + AppListItem* last_item = folder->item_list()->item_at(0);
|
| + MoveItemToFolderAt(last_item, "", folder->position());
|
| + }
|
| +}
|
| +
|
| void AppListModel::NotifyExtensionPreferenceChanged() {
|
| for (size_t i = 0; i < top_level_item_list_->item_count(); ++i)
|
| top_level_item_list_->item_at(i)->OnExtensionPreferenceChanged();
|
|
|