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

Unified Diff: chrome/browser/platform_util_mac.mm

Issue 613673003: [Mac] On Mavericks or later, use NSWorkspace to open download items. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | « base/mac/sdk_forward_declarations.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/platform_util_mac.mm
diff --git a/chrome/browser/platform_util_mac.mm b/chrome/browser/platform_util_mac.mm
index 20afdcd498551dc62f38e74f641dbd444b5b4003..10183615aed0341d5b4f2f06ed1ac6f559b5c002 100644
--- a/chrome/browser/platform_util_mac.mm
+++ b/chrome/browser/platform_util_mac.mm
@@ -11,6 +11,8 @@
#include "base/files/file_path.h"
#include "base/logging.h"
#include "base/mac/mac_logging.h"
+#import "base/mac/mac_util.h"
+#import "base/mac/sdk_forward_declarations.h"
#include "base/mac/scoped_aedesc.h"
#include "base/strings/sys_string_conversions.h"
#include "url/gurl.h"
@@ -38,6 +40,21 @@ void OpenItem(Profile* profile, const base::FilePath& full_path) {
if (!path_string)
return;
+ if (base::mac::IsOSMavericksOrLater()) {
Avi (use Gerrit) 2014/09/29 15:36:00 Fix the comment at the top of the function ("This
Robert Sesek 2014/09/29 15:41:16 Done.
+ NSURL* url = [NSURL fileURLWithPath:path_string];
+ if (!url)
+ return;
+
+ const NSWorkspaceLaunchOptions launch_options =
+ NSWorkspaceLaunchAsync | NSWorkspaceLaunchWithErrorPresentation;
+ [[NSWorkspace sharedWorkspace] openURLs:@[ url ]
+ withAppBundleIdentifier:nil
+ options:launch_options
+ additionalEventParamDescriptor:nil
+ launchIdentifiers:NULL]) {
+ return;
+ }
+
// Create the target of this AppleEvent, the Finder.
base::mac::ScopedAEDesc<AEAddressDesc> address;
const OSType finderCreatorCode = 'MACS';
« no previous file with comments | « base/mac/sdk_forward_declarations.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698