OLD | NEW |
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 #include "base/base_paths.h" | |
6 | |
7 #include <ostream> | 5 #include <ostream> |
8 #include <string> | 6 #include <string> |
9 | 7 |
10 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "base/base_paths.h" |
| 10 #include "base/base_paths_posix.h" |
11 #include "base/environment.h" | 11 #include "base/environment.h" |
12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
17 #include "base/nix/xdg_util.h" | 17 #include "base/nix/xdg_util.h" |
18 | 18 |
19 #if defined(OS_FREEBSD) | 19 #if defined(OS_FREEBSD) |
20 #include <sys/param.h> | 20 #include <sys/param.h> |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 // For example: out/{Debug|Release}/net_unittest | 92 // For example: out/{Debug|Release}/net_unittest |
93 if (PathService::Get(base::DIR_EXE, &path)) { | 93 if (PathService::Get(base::DIR_EXE, &path)) { |
94 *result = path.DirName().DirName(); | 94 *result = path.DirName().DirName(); |
95 return true; | 95 return true; |
96 } | 96 } |
97 | 97 |
98 DLOG(ERROR) << "Couldn't find your source root. " | 98 DLOG(ERROR) << "Couldn't find your source root. " |
99 << "Try running from your chromium/src directory."; | 99 << "Try running from your chromium/src directory."; |
100 return false; | 100 return false; |
101 } | 101 } |
| 102 case base::DIR_USER_DESKTOP: { |
| 103 *result = GetXDGUserDirectory("DESKTOP", "Desktop"); |
| 104 return true; |
| 105 } |
102 case base::DIR_CACHE: { | 106 case base::DIR_CACHE: { |
103 scoped_ptr<base::Environment> env(base::Environment::Create()); | 107 scoped_ptr<base::Environment> env(base::Environment::Create()); |
104 FilePath cache_dir(base::nix::GetXDGDirectory(env.get(), "XDG_CACHE_HOME", | 108 FilePath cache_dir(base::nix::GetXDGDirectory(env.get(), "XDG_CACHE_HOME", |
105 ".cache")); | 109 ".cache")); |
106 *result = cache_dir; | 110 *result = cache_dir; |
107 return true; | 111 return true; |
108 } | 112 } |
109 case base::DIR_HOME: { | 113 case base::DIR_HOME: { |
110 *result = file_util::GetHomeDir(); | 114 *result = file_util::GetHomeDir(); |
111 return true; | 115 return true; |
112 } | 116 } |
113 } | 117 } |
114 return false; | 118 return false; |
115 } | 119 } |
116 | 120 |
117 } // namespace base | 121 } // namespace base |
OLD | NEW |