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

Unified Diff: chrome/app_shim/chrome_main_app_mode_mac.mm

Issue 2390953003: [Mac Fix-It] Changed OpenApplicationWithPath to use NSWorkspace. (Closed)
Patch Set: Addressed review comments 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: 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..a6d38f95182530545be4234b7abf2420ac72af76 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,12 @@ 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)
+ base::Process app = base::mac::OpenApplicationWithPath(
+ base::mac::OuterBundlePath(), command_line, NSWorkspaceLaunchDefault);
+
+ // TODO(crbug.com/652563): Do not use deprecated GetProcessForPID. Change
+ // |ReplyEventHandler| to take |pid_t| instead of |ProcessSerialNumber|.
+ if (!app.IsValid() || GetProcessForPID(app.Pid(), &psn) != noErr)
return 1;
base::Callback<void(bool)> on_ping_chrome_reply =
« no previous file with comments | « chrome/app_shim/app_mode_loader_mac.mm ('k') | chrome/browser/apps/app_shim/app_shim_interactive_uitest_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698