launch_services_util.h 1020 B

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