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

Side by Side Diff: base/base_paths.cc

Issue 1647803004: Move base to DEPS (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « base/base_paths.h ('k') | base/base_paths_android.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "base/base_paths.h"
6
7 #include "base/files/file_path.h"
8 #include "base/files/file_util.h"
9 #include "base/path_service.h"
10
11 namespace base {
12
13 bool PathProvider(int key, FilePath* result) {
14 // NOTE: DIR_CURRENT is a special case in PathService::Get
15
16 switch (key) {
17 case DIR_EXE:
18 PathService::Get(FILE_EXE, result);
19 *result = result->DirName();
20 return true;
21 case DIR_MODULE:
22 PathService::Get(FILE_MODULE, result);
23 *result = result->DirName();
24 return true;
25 case DIR_TEMP:
26 if (!GetTempDir(result))
27 return false;
28 return true;
29 case base::DIR_HOME:
30 *result = GetHomeDir();
31 return true;
32 case DIR_TEST_DATA:
33 if (!PathService::Get(DIR_SOURCE_ROOT, result))
34 return false;
35 *result = result->Append(FILE_PATH_LITERAL("base"));
36 *result = result->Append(FILE_PATH_LITERAL("test"));
37 *result = result->Append(FILE_PATH_LITERAL("data"));
38 if (!PathExists(*result)) // We don't want to create this.
39 return false;
40 return true;
41 default:
42 return false;
43 }
44 }
45
46 } // namespace base
OLDNEW
« no previous file with comments | « base/base_paths.h ('k') | base/base_paths_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698