Index: chrome/app_shim/chrome_main_app_mode_mac.mm |
diff --git a/chrome/app_shim/chrome_main_app_mode_mac.mm b/chrome/app_shim/chrome_main_app_mode_mac.mm |
index ea203e5303d9d7257c86a202c90d0fd44f872830..7da8534f76f6265f82b3bbacf43b0b0972830fa2 100644 |
--- a/chrome/app_shim/chrome_main_app_mode_mac.mm |
+++ b/chrome/app_shim/chrome_main_app_mode_mac.mm |
@@ -17,7 +17,7 @@ |
#include "base/logging.h" |
#include "base/mac/bundle_locations.h" |
#include "base/mac/foundation_util.h" |
-#include "base/mac/launch_services_util.h" |
+#import "base/mac/launch_services_util.h" |
#include "base/mac/mac_logging.h" |
#include "base/mac/mac_util.h" |
#include "base/mac/scoped_nsautorelease_pool.h" |
@@ -681,12 +681,14 @@ int ChromeAppModeStart_v4(const app_mode::ChromeAppModeInfo* info) { |
info->profile_dir); |
} |
- bool success = |
- base::mac::OpenApplicationWithPath(base::mac::OuterBundlePath(), |
- command_line, |
- kLSLaunchDefaults, |
- &psn); |
- if (!success) |
+ pid_t new_pid = -1; |
+ bool success = base::mac::OpenApplicationWithPath( |
+ base::mac::OuterBundlePath(), command_line, NSWorkspaceLaunchDefault, |
+ &new_pid); |
+ |
+ // TODO(crbug.com/652563): Do not use deprecated GetProcessForPID. Change |
+ // |ReplyEventHandler| to take |pid_t| instead of |ProcessSerialNumber|. |
+ if (!success || GetProcessForPID(new_pid, &psn) != noErr) |
return 1; |
base::Callback<void(bool)> on_ping_chrome_reply = |