Chromium Code Reviews| Index: base/mac/launch_services_util.mm |
| diff --git a/base/mac/launch_services_util.mm b/base/mac/launch_services_util.mm |
| index fa6e8087e68e14e792a57ca533944edd33cb6d0e..897513aaf40637a0545ff68db685a7529d497515 100644 |
| --- a/base/mac/launch_services_util.mm |
| +++ b/base/mac/launch_services_util.mm |
| @@ -5,6 +5,7 @@ |
| #import "base/mac/launch_services_util.h" |
| #include "base/logging.h" |
| +#include "base/mac/scoped_nsobject.h" |
|
tapted
2016/10/26 00:14:48
nit: import
spqchan
2016/10/26 00:45:43
Done.
|
| #include "base/strings/sys_string_conversions.h" |
| namespace base { |
| @@ -12,7 +13,8 @@ namespace mac { |
| Process OpenApplicationWithPath(const base::FilePath& bundle_path, |
| const CommandLine& command_line, |
| - NSWorkspaceLaunchOptions launch_options) { |
| + NSWorkspaceLaunchOptions launch_options, |
| + NSAppleEventDescriptor* descriptor) { |
| NSString* bundle_url_spec = base::SysUTF8ToNSString(bundle_path.value()); |
| NSURL* bundle_url = [NSURL fileURLWithPath:bundle_url_spec isDirectory:YES]; |
| DCHECK(bundle_url); |
| @@ -29,9 +31,16 @@ Process OpenApplicationWithPath(const base::FilePath& bundle_path, |
| [launch_args addObject:base::SysUTF8ToNSString(argv[i])]; |
| } |
| - NSDictionary* configuration = @{ |
| - NSWorkspaceLaunchConfigurationArguments : launch_args, |
| - }; |
| + base::scoped_nsobject<NSMutableDictionary> configuration( |
| + [[NSMutableDictionary alloc] init]); |
| + [configuration setObject:launch_args |
|
tapted
2016/10/26 00:14:48
optional: we can use the shiny new ObjC syntax for
spqchan
2016/10/26 00:45:43
Done.
|
| + forKey:NSWorkspaceLaunchConfigurationArguments]; |
| + |
| + if (descriptor) { |
| + [configuration setObject:descriptor |
| + forKey:NSWorkspaceLaunchConfigurationAppleEvent]; |
| + } |
| + |
| NSError* launch_error = nil; |
| // TODO(jeremya): this opens a new browser window if Chrome is already |
| // running without any windows open. |