fix: make shell.moveItemToTrash return false on Windows when move unsuccessful (#25171)

This commit is contained in:
Markus Olsson
2020-08-27 17:43:52 -07:00
committed by GitHub
parent 5b53a08132
commit d6bea2a681
2 changed files with 40 additions and 1 deletions

View File

@@ -387,10 +387,14 @@ bool MoveItemToTrash(const base::FilePath& path, bool delete_on_fail) {
if (!delete_sink)
return false;
BOOL pfAnyOperationsAborted;
// Processes the queued command DeleteItem. This will trigger
// the DeleteFileProgressSink to check for Recycle Bin.
return SUCCEEDED(pfo->DeleteItem(delete_item.Get(), delete_sink.Get())) &&
SUCCEEDED(pfo->PerformOperations());
SUCCEEDED(pfo->PerformOperations()) &&
SUCCEEDED(pfo->GetAnyOperationsAborted(&pfAnyOperationsAborted)) &&
!pfAnyOperationsAborted;
}
bool GetFolderPath(int key, base::FilePath* result) {