Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3490)

Unified Diff: chrome/browser/download/download_manager.cc

Issue 172074: Show or open downloaded items on the UI thread for Mac (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/download/download_file.cc ('k') | chrome/browser/download/save_file_manager.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager.cc
===================================================================
--- chrome/browser/download/download_manager.cc (revision 23654)
+++ chrome/browser/download/download_manager.cc (working copy)
@@ -1233,10 +1233,16 @@
// user interface.
void DownloadManager::ShowDownloadInShell(const DownloadItem* download) {
DCHECK(file_manager_);
+ DCHECK(MessageLoop::current() == ui_loop_);
+#if defined(OS_MACOSX)
+ // Mac needs to run this operation on the UI thread.
+ platform_util::ShowItemInFolder(download->full_path());
+#else
file_loop_->PostTask(FROM_HERE,
NewRunnableMethod(file_manager_,
&DownloadFileManager::OnShowDownloadInShell,
FilePath(download->full_path())));
+#endif
}
void DownloadManager::OpenDownload(const DownloadItem* download,
@@ -1271,10 +1277,16 @@
void DownloadManager::OpenDownloadInShell(const DownloadItem* download,
gfx::NativeView parent_window) {
DCHECK(file_manager_);
+ DCHECK(MessageLoop::current() == ui_loop_);
+#if defined(OS_MACOSX)
+ // Mac OS X requires opening downloads on the UI thread.
+ platform_util::OpenItem(download->full_path());
+#else
file_loop_->PostTask(FROM_HERE,
NewRunnableMethod(file_manager_,
&DownloadFileManager::OnOpenDownloadInShell,
download->full_path(), download->url(), parent_window));
+#endif
}
void DownloadManager::OpenFilesOfExtension(
« no previous file with comments | « chrome/browser/download/download_file.cc ('k') | chrome/browser/download/save_file_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698