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

Unified Diff: chrome/common/chrome_paths_linux.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 | « chrome/common/auto_start_linux.cc ('k') | content/shell/shell_browser_context.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/chrome_paths_linux.cc
===================================================================
--- chrome/common/chrome_paths_linux.cc (revision 141792)
+++ chrome/common/chrome_paths_linux.cc (working copy)
@@ -12,15 +12,18 @@
namespace {
-const char kDotConfigDir[] = ".config";
const char kDownloadsDir[] = "Downloads";
const char kPicturesDir[] = "Pictures";
-const char kXdgConfigHomeEnvVar[] = "XDG_CONFIG_HOME";
} // namespace
namespace chrome {
+using base::nix::GetXDGDirectory;
+using base::nix::GetXDGUserDirectory;
+using base::nix::kDotConfigDir;
+using base::nix::kXdgConfigHomeEnvVar;
+
// See http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html
// for a spec on where config files go. The net effect for most
// systems is we use ~/.config/chromium/ for Chromium and
@@ -28,9 +31,9 @@
// (This also helps us sidestep issues with other apps grabbing ~/.chromium .)
bool GetDefaultUserDataDirectory(FilePath* result) {
scoped_ptr<base::Environment> env(base::Environment::Create());
- FilePath config_dir(base::nix::GetXDGDirectory(env.get(),
- kXdgConfigHomeEnvVar,
- kDotConfigDir));
+ FilePath config_dir(GetXDGDirectory(env.get(),
+ kXdgConfigHomeEnvVar,
+ kDotConfigDir));
#if defined(GOOGLE_CHROME_BUILD)
*result = config_dir.Append("google-chrome");
#else
@@ -56,9 +59,9 @@
FilePath cache_dir;
if (!PathService::Get(base::DIR_CACHE, &cache_dir))
return;
- FilePath config_dir(base::nix::GetXDGDirectory(env.get(),
- kXdgConfigHomeEnvVar,
- kDotConfigDir));
+ FilePath config_dir(GetXDGDirectory(env.get(),
+ kXdgConfigHomeEnvVar,
+ kDotConfigDir));
if (!config_dir.AppendRelativePath(profile_dir, &cache_dir))
return;
@@ -68,9 +71,9 @@
bool GetChromeFrameUserDataDirectory(FilePath* result) {
scoped_ptr<base::Environment> env(base::Environment::Create());
- FilePath config_dir(base::nix::GetXDGDirectory(env.get(),
- kXdgConfigHomeEnvVar,
- kDotConfigDir));
+ FilePath config_dir(GetXDGDirectory(env.get(),
+ kXdgConfigHomeEnvVar,
+ kDotConfigDir));
#if defined(GOOGLE_CHROME_BUILD)
*result = config_dir.Append("google-chrome-frame");
#else
@@ -80,7 +83,7 @@
}
bool GetUserDocumentsDirectory(FilePath* result) {
- *result = base::nix::GetXDGUserDirectory("DOCUMENTS", "Documents");
+ *result = GetXDGUserDirectory("DOCUMENTS", "Documents");
return true;
}
@@ -98,7 +101,7 @@
// We respect the user's preferred pictures location, unless it is
// ~ or their desktop directory, in which case we default to ~/Pictures.
bool GetUserPicturesDirectory(FilePath* result) {
- *result = base::nix::GetXDGUserDirectory("PICTURES", kPicturesDir);
+ *result = GetXDGUserDirectory("PICTURES", kPicturesDir);
FilePath home = file_util::GetHomeDir();
if (*result != home) {
@@ -114,7 +117,7 @@
}
bool GetUserDesktop(FilePath* result) {
- *result = base::nix::GetXDGUserDirectory("DESKTOP", "Desktop");
+ *result = GetXDGUserDirectory("DESKTOP", "Desktop");
return true;
}
« no previous file with comments | « chrome/common/auto_start_linux.cc ('k') | content/shell/shell_browser_context.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698