1 // Copyright 2017 The Chromium Embedded Framework Authors. Portions copyright 2 // 2011 The Chromium Authors. All rights reserved. Use of this source code is 3 // governed by a BSD-style license that can be found in the LICENSE file. 4 5 #ifndef CEF_LIBCEF_COMMON_UTIL_MAC_H_ 6 #define CEF_LIBCEF_COMMON_UTIL_MAC_H_ 7 #pragma once 8 9 #include <string> 10 11 namespace base { 12 class FilePath; 13 } 14 15 namespace util_mac { 16 17 // Returns the path to the NSLibraryDirectory (e.g. "~/Library"). 18 bool GetLocalLibraryDirectory(base::FilePath* result); 19 20 // Returns the path to the CEF framework directory inside the top-level app 21 // bundle (e.g. "myapp.app/Contents/Frameworks/Chromium Embedded 22 // Framework.framework"). May return an empty value if not running in an app 23 // bundle. 24 base::FilePath GetFrameworkDirectory(); 25 26 // Returns the path to the Resources directory inside the CEF framework 27 // directory (e.g. "myapp.app/Contents/Frameworks/Chromium Embedded 28 // Framework.framework/Resources"). May return an empty value if not running in 29 // an app bundle. 30 base::FilePath GetFrameworkResourcesDirectory(); 31 32 // Returns the path to the main (running) process executable (e.g. 33 // "myapp.app/Contents/MacOS/myapp"). 34 base::FilePath GetMainProcessPath(); 35 36 // Returns the path to the top-level app bundle that contains the main process 37 // executable (e.g. "myapp.app"). 38 base::FilePath GetMainBundlePath(); 39 40 // Returns the identifier for the top-level app bundle. 41 std::string GetMainBundleID(); 42 43 // Returns the path to the Resources directory inside the top-level app bundle 44 // (e.g. "myapp.app/Contents/Resources"). May return an empty value if not 45 // running in an app bundle. 46 base::FilePath GetMainResourcesDirectory(); 47 48 // Returns the path to the child process executable (e.g. "myapp.app/ 49 // Contents/Frameworks/myapp Helper.app/Contents/MacOS/myapp Helper"). May 50 // return an empty value if not running in an app bundle. 51 base::FilePath GetChildProcessPath(); 52 53 // Called from MainDelegate::PreSandboxStartup for the main process. 54 void PreSandboxStartup(); 55 56 // Called from MainDelegate::BasicStartupComplete for all processes. 57 void BasicStartupComplete(); 58 59 } // namespace util_mac 60 61 #endif // CEF_LIBCEF_COMMON_UTIL_MAC_H_ 62