diff options
author | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-02 08:45:01 +0000 |
---|---|---|
committer | thestig@chromium.org <thestig@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-02 08:45:01 +0000 |
commit | 9e9b6e8ee77229781fa8581b7f46413024404a5f (patch) | |
tree | 5b3dfc45e4e65db382138b64e5a63ac3c3b0dad6 /base/linux_util.h | |
parent | 7aadea0cf98791bbbf163b0d2ef078c7697fea4e (diff) | |
download | chromium_src-9e9b6e8ee77229781fa8581b7f46413024404a5f.zip chromium_src-9e9b6e8ee77229781fa8581b7f46413024404a5f.tar.gz chromium_src-9e9b6e8ee77229781fa8581b7f46413024404a5f.tar.bz2 |
Move some XDG code from chrome to base, make DIR_USER_CACHE generic rather than Chromium specific, and clean up a few headers.
BUG=none
TEST=none
Review URL: http://codereview.chromium.org/449048
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33565 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/linux_util.h')
-rw-r--r-- | base/linux_util.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/base/linux_util.h b/base/linux_util.h index 1da519e..b62f7cc 100644 --- a/base/linux_util.h +++ b/base/linux_util.h @@ -10,6 +10,8 @@ #include <string> +class FilePath; + namespace base { static const char kFindInodeSwitch[] = "--find-inode"; @@ -35,6 +37,23 @@ class EnvironmentVariableGetter { static EnvironmentVariableGetter* Create(); }; +// Get the home directory. +FilePath GetHomeDir(EnvironmentVariableGetter* env); + +// Utility function for getting XDG directories. +// |env_name| is the name of an environment variable that we want to use to get +// a directory path. |fallback_dir| is the directory relative to $HOME that we +// use if |env_name| cannot be found or is empty. |fallback_dir| may be NULL. +// Examples of |env_name| are XDG_CONFIG_HOME and XDG_DATA_HOME. +FilePath GetXDGDirectory(EnvironmentVariableGetter* env, + const char* env_name, const char* fallback_dir); + +// Wrapper around xdg_user_dir_lookup() from src/base/third_party/xdg-user-dirs +// This looks up "well known" user directories like the desktop and music +// folder. Examples of |dir_name| are DESKTOP and MUSIC. +FilePath GetXDGUserDirectory(EnvironmentVariableGetter* env, + const char* dir_name, const char* fallback_dir); + enum DesktopEnvironment { DESKTOP_ENVIRONMENT_OTHER, DESKTOP_ENVIRONMENT_GNOME, |