launch_services_util.h 994 B

12345678910111213141516171819202122232425262728
  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. #ifndef BASE_MAC_LAUNCH_SERVICES_UTIL_H_
  5. #define BASE_MAC_LAUNCH_SERVICES_UTIL_H_
  6. #import <AppKit/AppKit.h>
  7. #include "base/base_export.h"
  8. #include "base/command_line.h"
  9. #include "base/files/file_path.h"
  10. namespace base::mac {
  11. // Launches the application bundle at |bundle_path|, passing argv[1..] from
  12. // |command_line| as command line arguments if the app isn't already running.
  13. // |launch_options| are passed directly to
  14. // -[NSWorkspace launchApplicationAtURL:options:configuration:error:].
  15. // Returns a non-nil NSRunningApplication if the app was successfully launched.
  16. BASE_EXPORT NSRunningApplication* OpenApplicationWithPath(
  17. const FilePath& bundle_path,
  18. const CommandLine& command_line,
  19. NSWorkspaceLaunchOptions launch_options);
  20. } // namespace base::mac
  21. #endif // BASE_MAC_LAUNCH_SERVICES_UTIL_H_