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

Side by Side Diff: base/base_paths_posix.cc

Issue 1606007: Move EnvironmentVariableGetter from base/linux_util.h to base/env_var.h. Labe... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix windows build for good this time? Created 10 years, 8 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 | « base/base.gypi ('k') | base/env_var.h » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 // This is really Posix minus Mac. Mac code is in base_paths_mac.mm. 5 // This is really Posix minus Mac. Mac code is in base_paths_mac.mm.
6 6
7 #include "base/base_paths.h" 7 #include "base/base_paths.h"
8 8
9 #include <unistd.h> 9 #include <unistd.h>
10 10
11 #include "base/env_var.h"
11 #include "base/file_path.h" 12 #include "base/file_path.h"
12 #include "base/file_util.h" 13 #include "base/file_util.h"
13 #include "base/linux_util.h" 14 #include "base/linux_util.h"
14 #include "base/logging.h" 15 #include "base/logging.h"
15 #include "base/path_service.h" 16 #include "base/path_service.h"
16 #include "base/scoped_ptr.h" 17 #include "base/scoped_ptr.h"
17 #include "base/sys_string_conversions.h" 18 #include "base/sys_string_conversions.h"
18 19
19 namespace base { 20 namespace base {
20 21
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 // drive) try assuming the current directory is the source root. 56 // drive) try assuming the current directory is the source root.
56 if (file_util::GetCurrentDirectory(&path) && 57 if (file_util::GetCurrentDirectory(&path) &&
57 file_util::PathExists(path.Append("base/base_paths_posix.cc"))) { 58 file_util::PathExists(path.Append("base/base_paths_posix.cc"))) {
58 *result = path; 59 *result = path;
59 return true; 60 return true;
60 } 61 }
61 LOG(ERROR) << "Couldn't find your source root. " 62 LOG(ERROR) << "Couldn't find your source root. "
62 << "Try running from your chromium/src directory."; 63 << "Try running from your chromium/src directory.";
63 return false; 64 return false;
64 case base::DIR_USER_CACHE: 65 case base::DIR_USER_CACHE:
65 scoped_ptr<base::EnvironmentVariableGetter> env( 66 scoped_ptr<base::EnvVarGetter> env(base::EnvVarGetter::Create());
66 base::EnvironmentVariableGetter::Create());
67 FilePath cache_dir(base::GetXDGDirectory(env.get(), "XDG_CACHE_HOME", 67 FilePath cache_dir(base::GetXDGDirectory(env.get(), "XDG_CACHE_HOME",
68 ".cache")); 68 ".cache"));
69 *result = cache_dir; 69 *result = cache_dir;
70 return true; 70 return true;
71 } 71 }
72 return false; 72 return false;
73 } 73 }
74 74
75 } // namespace base 75 } // namespace base
OLDNEW
« no previous file with comments | « base/base.gypi ('k') | base/env_var.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698