James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef BASE_MAC_LAUNCH_SERVICES_UTIL_H_ |
| 6 | #define BASE_MAC_LAUNCH_SERVICES_UTIL_H_ |
| 7 | |
James Robinson | f19b102 | 2015-05-05 18:12:15 -0700 | [diff] [blame] | 8 | #include <CoreServices/CoreServices.h> |
James Robinson | 646469d | 2014-10-03 15:33:28 -0700 | [diff] [blame] | 9 | |
| 10 | #include "base/base_export.h" |
| 11 | #include "base/command_line.h" |
| 12 | #include "base/files/file_path.h" |
| 13 | |
| 14 | struct ProcessSerialNumber; |
| 15 | |
| 16 | namespace base { |
| 17 | namespace mac { |
| 18 | |
| 19 | // Launches the application bundle at |bundle_path|, passing argv[1..] from |
| 20 | // |command_line| as command line arguments if the app isn't already running. |
| 21 | // |launch_flags| are passed directly to LSApplicationParameters. |
| 22 | // |out_psn|, if not NULL, will be set to the process serial number of the |
| 23 | // application's main process if the app was successfully launched. |
| 24 | // Returns true if the app was successfully launched. |
| 25 | BASE_EXPORT bool OpenApplicationWithPath(const FilePath& bundle_path, |
| 26 | const CommandLine& command_line, |
| 27 | LSLaunchFlags launch_flags, |
| 28 | ProcessSerialNumber* out_psn); |
| 29 | |
| 30 | } // namespace mac |
| 31 | } // namespace base |
| 32 | |
| 33 | #endif // BASE_MAC_LAUNCH_SERVICES_UTIL_H_ |