summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-10 16:12:48 +0000
committerstuartmorgan@chromium.org <stuartmorgan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-10 16:12:48 +0000
commit1805b51645d51ee08205aa8e5cc3c72404ab8960 (patch)
tree6775b482265c7b4a9918d66ce670234f4b609ffa
parente69b8584b153c5db5793f84d86da7c8949b8dfd1 (diff)
downloadchromium_src-1805b51645d51ee08205aa8e5cc3c72404ab8960.zip
chromium_src-1805b51645d51ee08205aa8e5cc3c72404ab8960.tar.gz
chromium_src-1805b51645d51ee08205aa8e5cc3c72404ab8960.tar.bz2
Implement OpenItem on the Mac, and have the download manager call it when clicking a file link.
BUG=13552 TEST=Clicking a file link in the download manager should open the file. Review URL: http://codereview.chromium.org/119398 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18061 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/download/download_file.cc7
-rw-r--r--chrome/common/platform_util_mac.mm3
2 files changed, 8 insertions, 2 deletions
diff --git a/chrome/browser/download/download_file.cc b/chrome/browser/download/download_file.cc
index 7be3411..8731b53 100644
--- a/chrome/browser/download/download_file.cc
+++ b/chrome/browser/download/download_file.cc
@@ -544,8 +544,13 @@ void DownloadFileManager::OnOpenDownloadInShell(const FilePath& full_path,
} else {
win_util::OpenItemViaShell(full_path);
}
+#elif defined(OS_MACOSX)
+ // Quarantine takes care of asking the user about dangerous files, so we can
+ // just open it.
+ platform_util::OpenItem(full_path);
#else
- // TODO(port) implement me.
+ // TODO(port) implement me. (Does Linux need to use a "safe" open, or can it
+ // just share the Mac call to platform_util?)
NOTIMPLEMENTED();
#endif
}
diff --git a/chrome/common/platform_util_mac.mm b/chrome/common/platform_util_mac.mm
index c3a4ab7..41ca53b 100644
--- a/chrome/common/platform_util_mac.mm
+++ b/chrome/common/platform_util_mac.mm
@@ -22,7 +22,8 @@ void ShowItemInFolder(const FilePath& full_path) {
}
void OpenItem(const FilePath& full_path) {
- NOTIMPLEMENTED();
+ NSString* path_string = base::SysUTF8ToNSString(full_path.value());
+ [[NSWorkspace sharedWorkspace] openFile:path_string];
}
gfx::NativeWindow GetTopLevel(gfx::NativeView view) {