Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2498)

Unified Diff: base/linux_util.h

Issue 449048: Move some XDG code from chrome to base. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix linux base_unittest Created 11 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/base_paths_posix.cc ('k') | base/linux_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/linux_util.h
===================================================================
--- base/linux_util.h (revision 33536)
+++ base/linux_util.h (working copy)
@@ -10,6 +10,8 @@
#include <string>
+class FilePath;
+
namespace base {
static const char kFindInodeSwitch[] = "--find-inode";
@@ -35,6 +37,23 @@
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,
« no previous file with comments | « base/base_paths_posix.cc ('k') | base/linux_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698