From 8b6ff019c982f3929cf09b7090c9ec38c2751fc1 Mon Sep 17 00:00:00 2001 From: "paul@chromium.org" Date: Tue, 18 Aug 2009 22:29:58 +0000 Subject: Show or open downloaded items on the UI thread for Mac. This is required because NSWorkspace, which is used for the open or show operation, must be called on the main thread. BUG=19447 (http://crbug.com/19447) TEST=Repro steps fully described in the bug report. Review URL: http://codereview.chromium.org/172074 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@23667 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/download/download_file.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'chrome/browser/download/download_file.cc') diff --git a/chrome/browser/download/download_file.cc b/chrome/browser/download/download_file.cc index 970cc49..bf439f0 100644 --- a/chrome/browser/download/download_file.cc +++ b/chrome/browser/download/download_file.cc @@ -526,14 +526,17 @@ void DownloadFileManager::OnDownloadUrl(const GURL& url, // Open a download, or show it in a file explorer window. We run on this // thread to avoid blocking the UI with (potentially) slow Shell operations. // TODO(paulg): File 'stat' operations. +#if !defined(OS_MACOSX) void DownloadFileManager::OnShowDownloadInShell(const FilePath& full_path) { DCHECK(MessageLoop::current() == file_loop_); platform_util::ShowItemInFolder(full_path); } +#endif // Launches the selected download using ShellExecute 'open' verb. For windows, // if there is a valid parent window, the 'safer' version will be used which can // display a modal dialog asking for user consent on dangerous files. +#if !defined(OS_MACOSX) void DownloadFileManager::OnOpenDownloadInShell(const FilePath& full_path, const GURL& url, gfx::NativeView parent_window) { @@ -545,9 +548,9 @@ void DownloadFileManager::OnOpenDownloadInShell(const FilePath& full_path, return; } #endif - platform_util::OpenItem(full_path); } +#endif // OS_MACOSX // The DownloadManager in the UI thread has provided a final name for the // download specified by 'id'. Rename the in progress download, and remove it -- cgit v1.1