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

Unified Diff: base/mac/launch_services_util.mm

Issue 2416313002: Prepare chrome_main_app_mode_mac.mm for 10.9 (Closed)
Patch Set: Cleaned up Created 4 years, 2 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
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.

Powered by Google App Engine
This is Rietveld 408576698