| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 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 | 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" | 5 #include "base/base_paths.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 PathService::Get(FILE_MODULE, result); | 22 PathService::Get(FILE_MODULE, result); |
| 23 *result = result->DirName(); | 23 *result = result->DirName(); |
| 24 return true; | 24 return true; |
| 25 case DIR_TEMP: | 25 case DIR_TEMP: |
| 26 if (!GetTempDir(result)) | 26 if (!GetTempDir(result)) |
| 27 return false; | 27 return false; |
| 28 return true; | 28 return true; |
| 29 case base::DIR_HOME: | 29 case base::DIR_HOME: |
| 30 *result = GetHomeDir(); | 30 *result = GetHomeDir(); |
| 31 return true; | 31 return true; |
| 32 case DIR_TEST_DATA: | 32 case DIR_TEST_DATA: { |
| 33 if (!PathService::Get(DIR_SOURCE_ROOT, result)) | 33 FilePath test_data_path; |
| 34 if (!PathService::Get(DIR_SOURCE_ROOT, &test_data_path)) |
| 34 return false; | 35 return false; |
| 35 *result = result->Append(FILE_PATH_LITERAL("base")); | 36 test_data_path = test_data_path.Append(FILE_PATH_LITERAL("base")); |
| 36 *result = result->Append(FILE_PATH_LITERAL("test")); | 37 test_data_path = test_data_path.Append(FILE_PATH_LITERAL("test")); |
| 37 *result = result->Append(FILE_PATH_LITERAL("data")); | 38 test_data_path = test_data_path.Append(FILE_PATH_LITERAL("data")); |
| 38 if (!PathExists(*result)) // We don't want to create this. | 39 if (!PathExists(test_data_path)) // We don't want to create this. |
| 39 return false; | 40 return false; |
| 41 *result = test_data_path; |
| 40 return true; | 42 return true; |
| 43 } |
| 41 default: | 44 default: |
| 42 return false; | 45 return false; |
| 43 } | 46 } |
| 44 } | 47 } |
| 45 | 48 |
| 46 } // namespace base | 49 } // namespace base |
| OLD | NEW |