From 5968af3021ae91fe1cac7467762a1ffcb377499b Mon Sep 17 00:00:00 2001 From: "avi@google.com" Date: Mon, 23 Nov 2009 17:57:54 +0000 Subject: Call FNNotify on download complete; this should help apps watching the downloads folder. BUG=none TEST=If Transmission is watching the Downloads folder, it should catch a completed download immediately. Review URL: http://codereview.chromium.org/437006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32808 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/cocoa/download_util_mac.mm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'chrome/browser/cocoa/download_util_mac.mm') diff --git a/chrome/browser/cocoa/download_util_mac.mm b/chrome/browser/cocoa/download_util_mac.mm index 8eb9a62..479ab7f 100644 --- a/chrome/browser/cocoa/download_util_mac.mm +++ b/chrome/browser/cocoa/download_util_mac.mm @@ -23,9 +23,16 @@ void AddFileToPasteboard(NSPasteboard* pasteboard, const FilePath& path) { } void NotifySystemOfDownloadComplete(const FilePath& path) { + NSString* filePath = base::SysUTF8ToNSString(path.value()); [[NSDistributedNotificationCenter defaultCenter] postNotificationName:@"com.apple.DownloadFileFinished" - object:base::SysUTF8ToNSString(path.value())]; + object:filePath]; + + NSString* parentPath = [filePath stringByDeletingLastPathComponent]; + FNNotifyByPath( + reinterpret_cast([parentPath fileSystemRepresentation]), + kFNDirectoryModifiedMessage, + kNilOptions); } void DragDownload(const DownloadItem* download, -- cgit v1.1