| 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 "content/public/common/content_paths.h" | 5 #include "content/public/common/content_paths.h" |
| 6 | 6 |
| 7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
| 8 #include "base/mac/bundle_locations.h" | 8 #include "base/mac/bundle_locations.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 | 10 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 } | 30 } |
| 31 case DIR_MEDIA_LIBS: { | 31 case DIR_MEDIA_LIBS: { |
| 32 #if defined(OS_MACOSX) | 32 #if defined(OS_MACOSX) |
| 33 *result = base::mac::FrameworkBundlePath(); | 33 *result = base::mac::FrameworkBundlePath(); |
| 34 *result = result->Append("Libraries"); | 34 *result = result->Append("Libraries"); |
| 35 return true; | 35 return true; |
| 36 #else | 36 #else |
| 37 return PathService::Get(base::DIR_MODULE, result); | 37 return PathService::Get(base::DIR_MODULE, result); |
| 38 #endif | 38 #endif |
| 39 } | 39 } |
| 40 case DIR_LAYOUT_TESTS: { | |
| 41 base::FilePath cur; | |
| 42 if (!PathService::Get(DIR_TEST_DATA, &cur)) | |
| 43 return false; | |
| 44 cur = cur.Append(FILE_PATH_LITERAL("layout_tests")); | |
| 45 cur = cur.Append(FILE_PATH_LITERAL("LayoutTests")); | |
| 46 if (file_util::DirectoryExists(cur)) { | |
| 47 *result = cur; | |
| 48 return true; | |
| 49 } | |
| 50 if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur)) | |
| 51 return false; | |
| 52 cur = cur.Append(FILE_PATH_LITERAL("third_party")); | |
| 53 cur = cur.Append(FILE_PATH_LITERAL("WebKit")); | |
| 54 cur = cur.Append(FILE_PATH_LITERAL("LayoutTests")); | |
| 55 *result = cur; | |
| 56 return true; | |
| 57 } | |
| 58 default: | 40 default: |
| 59 return false; | 41 return false; |
| 60 } | 42 } |
| 61 | 43 |
| 62 return false; | 44 return false; |
| 63 } | 45 } |
| 64 | 46 |
| 65 // This cannot be done as a static initializer sadly since Visual Studio will | 47 // This cannot be done as a static initializer sadly since Visual Studio will |
| 66 // eliminate this object file if there is no direct entry point into it. | 48 // eliminate this object file if there is no direct entry point into it. |
| 67 void RegisterPathProvider() { | 49 void RegisterPathProvider() { |
| 68 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 50 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
| 69 } | 51 } |
| 70 | 52 |
| 71 } // namespace content | 53 } // namespace content |
| OLD | NEW |