Linux: Update user data path docs (see issue #3149)

This commit is contained in:
Marshall Greenblatt
2021-08-11 13:15:03 -04:00
parent 64221256a0
commit b4cf6e54de
2 changed files with 18 additions and 19 deletions

View File

@@ -260,14 +260,14 @@ typedef struct _cef_settings_t {
cef_string_t root_cache_path; cef_string_t root_cache_path;
/// ///
// The location where user data such as spell checking dictionary files will // The location where user data such as the Widevine CDM module and spell
// be stored on disk. If this value is empty then the default // checking dictionary files will be stored on disk. If this value is empty
// platform-specific user data directory will be used ("~/.cef_user_data" // then the default platform-specific user data directory will be used
// directory on Linux, "~/Library/Application Support/CEF/User Data" directory // ("~/.config/cef_user_data" directory on Linux, "~/Library/Application
// on Mac OS X, "AppData\Local\CEF\User Data" directory under the user profile // Support/CEF/User Data" directory on MacOS, "AppData\Local\CEF\User Data"
// directory on Windows). If this value is non-empty then it must be an // directory under the user profile directory on Windows). If this value is
// absolute path. When using the Chrome runtime this value will be ignored in // non-empty then it must be an absolute path. When using the Chrome runtime
// favor of the |root_cache_path| value. // this value will be ignored in favor of the |root_cache_path| value.
/// ///
cef_string_t user_data_path; cef_string_t user_data_path;
@@ -320,7 +320,7 @@ typedef struct _cef_settings_t {
/// ///
// The directory and file name to use for the debug log. If empty a default // The directory and file name to use for the debug log. If empty a default
// log file name and location will be used. On Windows and Linux a "debug.log" // log file name and location will be used. On Windows and Linux a "debug.log"
// file will be written in the main executable directory. On Mac OS X a // file will be written in the main executable directory. On MacOS a
// "~/Library/Logs/<app name>_debug.log" file will be written where <app name> // "~/Library/Logs/<app name>_debug.log" file will be written where <app name>
// is the name of the main app executable. Also configurable using the // is the name of the main app executable. Also configurable using the
// "log-file" command-line switch. // "log-file" command-line switch.
@@ -346,7 +346,7 @@ typedef struct _cef_settings_t {
/// ///
// The fully qualified path for the resources directory. If this value is // The fully qualified path for the resources directory. If this value is
// empty the *.pak files must be located in the module directory on // empty the *.pak files must be located in the module directory on
// Windows/Linux or the app bundle Resources directory on Mac OS X. If this // Windows/Linux or the app bundle Resources directory on MacOS. If this
// value is non-empty then it must be an absolute path. Also configurable // value is non-empty then it must be an absolute path. Also configurable
// using the "resources-dir-path" command-line switch. // using the "resources-dir-path" command-line switch.
/// ///
@@ -356,9 +356,9 @@ typedef struct _cef_settings_t {
// The fully qualified path for the locales directory. If this value is empty // The fully qualified path for the locales directory. If this value is empty
// the locales directory must be located in the module directory. If this // the locales directory must be located in the module directory. If this
// value is non-empty then it must be an absolute path. This value is ignored // value is non-empty then it must be an absolute path. This value is ignored
// on Mac OS X where pack files are always loaded from the app bundle // on MacOS where pack files are always loaded from the app bundle Resources
// Resources directory. Also configurable using the "locales-dir-path" // directory. Also configurable using the "locales-dir-path" command-line
// command-line switch. // switch.
/// ///
cef_string_t locales_dir_path; cef_string_t locales_dir_path;
@@ -918,7 +918,7 @@ typedef enum {
/// ///
// "Application Data" directory under the user profile directory on Windows // "Application Data" directory under the user profile directory on Windows
// and "~/Library/Application Support" directory on Mac OS X. // and "~/Library/Application Support" directory on MacOS.
/// ///
PK_USER_DATA, PK_USER_DATA,

View File

@@ -43,10 +43,8 @@ namespace {
// Based on chrome/common/chrome_paths_linux.cc. // Based on chrome/common/chrome_paths_linux.cc.
// See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html // See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
// for a spec on where config files go. The net effect for most // for a spec on where config files go. The net result on most systems is that
// systems is we use ~/.config/chromium/ for Chromium and // we use "~/.config/cef_user_data".
// ~/.config/google-chrome/ for official builds.
// (This also helps us sidestep issues with other apps grabbing ~/.chromium .)
bool GetDefaultUserDataDirectory(base::FilePath* result) { bool GetDefaultUserDataDirectory(base::FilePath* result) {
std::unique_ptr<base::Environment> env(base::Environment::Create()); std::unique_ptr<base::Environment> env(base::Environment::Create());
base::FilePath config_dir(base::nix::GetXDGDirectory( base::FilePath config_dir(base::nix::GetXDGDirectory(
@@ -214,7 +212,8 @@ void OverrideUserDataDir(CefSettings* settings,
// Path used for spell checking dictionary files. // Path used for spell checking dictionary files.
base::PathService::OverrideAndCreateIfNeeded( base::PathService::OverrideAndCreateIfNeeded(
chrome::DIR_APP_DICTIONARIES, user_data_path.AppendASCII("Dictionaries"), chrome::DIR_APP_DICTIONARIES,
user_data_path.Append(FILE_PATH_LITERAL("Dictionaries")),
false, // May not be an absolute path. false, // May not be an absolute path.
true); // Create if necessary. true); // Create if necessary.
} }