Merge pull request #1387 from deepak1556/shell_patch

shell: fix regression for moveItemToTrash on mac
This commit is contained in:
Cheng Zhao 2015-04-13 14:51:59 +08:00
commit eddb23d56b

View file

@ -131,7 +131,7 @@ bool MoveItemToTrash(const base::FilePath& full_path) {
NSString* path_string = base::SysUTF8ToNSString(full_path.value()); NSString* path_string = base::SysUTF8ToNSString(full_path.value());
NSArray* file_array = NSArray* file_array =
[NSArray arrayWithObject:[path_string lastPathComponent]]; [NSArray arrayWithObject:[path_string lastPathComponent]];
int status = [[NSWorkspace sharedWorkspace] BOOL status = [[NSWorkspace sharedWorkspace]
performFileOperation:NSWorkspaceRecycleOperation performFileOperation:NSWorkspaceRecycleOperation
source:[path_string stringByDeletingLastPathComponent] source:[path_string stringByDeletingLastPathComponent]
destination:@"" destination:@""
@ -140,7 +140,7 @@ bool MoveItemToTrash(const base::FilePath& full_path) {
if (!path_string || !file_array || !status) if (!path_string || !file_array || !status)
LOG(WARNING) << "NSWorkspace failed to move file " << full_path.value() LOG(WARNING) << "NSWorkspace failed to move file " << full_path.value()
<< " to trash"; << " to trash";
return (status == 0); return status;
} }
void Beep() { void Beep() {