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

Side by Side Diff: base/nix/xdg_util.h

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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | base/nix/xdg_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BASE_NIX_XDG_UTIL_H_ 5 #ifndef BASE_NIX_XDG_UTIL_H_
6 #define BASE_NIX_XDG_UTIL_H_ 6 #define BASE_NIX_XDG_UTIL_H_
7 #pragma once 7 #pragma once
8 8
9 // XDG refers to http://en.wikipedia.org/wiki/Freedesktop.org . 9 // XDG refers to http://en.wikipedia.org/wiki/Freedesktop.org .
10 // This file contains utilities found across free desktop environments. 10 // This file contains utilities found across free desktop environments.
11 // 11 //
12 // TODO(brettw) this file should be in app/x11, but is currently used by 12 // TODO(brettw) this file should be in app/x11, but is currently used by
13 // net. We should have a net API to allow the embedder to specify the behavior 13 // net. We should have a net API to allow the embedder to specify the behavior
14 // that it uses XDG for, and then move this file. 14 // that it uses XDG for, and then move this file.
15 15
16 #include "base/base_export.h" 16 #include "base/base_export.h"
17 17
18 #ifdef nix 18 #ifdef nix
19 #error asdf 19 #error asdf
20 #endif 20 #endif
21 21
22 class FilePath; 22 class FilePath;
23 23
24 namespace base { 24 namespace base {
25 25
26 class Environment; 26 class Environment;
27 27
28 namespace nix { 28 namespace nix {
29 29
30 // The default XDG config directory name.
31 BASE_EXPORT extern const char kDotConfigDir[];
32
33 // The XDG config directory environment variable.
34 BASE_EXPORT extern const char kXdgConfigHomeEnvVar[];
35
30 // Utility function for getting XDG directories. 36 // Utility function for getting XDG directories.
31 // |env_name| is the name of an environment variable that we want to use to get 37 // |env_name| is the name of an environment variable that we want to use to get
32 // a directory path. |fallback_dir| is the directory relative to $HOME that we 38 // a directory path. |fallback_dir| is the directory relative to $HOME that we
33 // use if |env_name| cannot be found or is empty. |fallback_dir| may be NULL. 39 // use if |env_name| cannot be found or is empty. |fallback_dir| may be NULL.
34 // Examples of |env_name| are XDG_CONFIG_HOME and XDG_DATA_HOME. 40 // Examples of |env_name| are XDG_CONFIG_HOME and XDG_DATA_HOME.
35 BASE_EXPORT FilePath GetXDGDirectory(Environment* env, const char* env_name, 41 BASE_EXPORT FilePath GetXDGDirectory(Environment* env, const char* env_name,
36 const char* fallback_dir); 42 const char* fallback_dir);
37 43
38 // Wrapper around xdg_user_dir_lookup() from src/base/third_party/xdg-user-dirs 44 // Wrapper around xdg_user_dir_lookup() from src/base/third_party/xdg-user-dirs
39 // This looks up "well known" user directories like the desktop and music 45 // This looks up "well known" user directories like the desktop and music
(...skipping 20 matching lines...) Expand all
60 // Return a string representation of the given desktop environment. 66 // Return a string representation of the given desktop environment.
61 // May return NULL in the case of DESKTOP_ENVIRONMENT_OTHER. 67 // May return NULL in the case of DESKTOP_ENVIRONMENT_OTHER.
62 BASE_EXPORT const char* GetDesktopEnvironmentName(DesktopEnvironment env); 68 BASE_EXPORT const char* GetDesktopEnvironmentName(DesktopEnvironment env);
63 // Convenience wrapper that calls GetDesktopEnvironment() first. 69 // Convenience wrapper that calls GetDesktopEnvironment() first.
64 BASE_EXPORT const char* GetDesktopEnvironmentName(Environment* env); 70 BASE_EXPORT const char* GetDesktopEnvironmentName(Environment* env);
65 71
66 } // namespace nix 72 } // namespace nix
67 } // namespace base 73 } // namespace base
68 74
69 #endif // BASE_NIX_XDG_UTIL_H_ 75 #endif // BASE_NIX_XDG_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | base/nix/xdg_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698