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

Unified Diff: base/nix/xdg_util.cc

Issue 10548019: Cleanup: Consolidate declarations of XDG variables. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 years, 6 months 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/nix/xdg_util.h ('k') | chrome/common/auto_start_linux.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/nix/xdg_util.cc
===================================================================
--- base/nix/xdg_util.cc (revision 141792)
+++ base/nix/xdg_util.cc (working copy)
@@ -11,9 +11,19 @@
#include "base/file_util.h"
#include "base/third_party/xdg_user_dirs/xdg_user_dir_lookup.h"
+namespace {
+
+// The KDE session version environment variable used in KDE 4.
+const char kKDE4SessionEnvVar[] = "KDE_SESSION_VERSION";
+
+} // namespace
+
namespace base {
namespace nix {
+const char kDotConfigDir[] = ".config";
+const char kXdgConfigHomeEnvVar[] = "XDG_CONFIG_HOME";
+
FilePath GetXDGDirectory(Environment* env, const char* env_name,
const char* fallback_dir) {
FilePath path;
@@ -46,7 +56,7 @@
return DESKTOP_ENVIRONMENT_KDE4;
} else if (desktop_session == "kde") {
// This may mean KDE4 on newer systems, so we have to check.
- if (env->HasVar("KDE_SESSION_VERSION"))
+ if (env->HasVar(kKDE4SessionEnvVar))
return DESKTOP_ENVIRONMENT_KDE4;
return DESKTOP_ENVIRONMENT_KDE3;
} else if (desktop_session.find("xfce") != std::string::npos ||
@@ -60,7 +70,7 @@
if (env->HasVar("GNOME_DESKTOP_SESSION_ID")) {
return DESKTOP_ENVIRONMENT_GNOME;
} else if (env->HasVar("KDE_FULL_SESSION")) {
- if (env->HasVar("KDE_SESSION_VERSION"))
+ if (env->HasVar(kKDE4SessionEnvVar))
return DESKTOP_ENVIRONMENT_KDE4;
return DESKTOP_ENVIRONMENT_KDE3;
}
« no previous file with comments | « base/nix/xdg_util.h ('k') | chrome/common/auto_start_linux.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698