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/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/mac/bundle_locations.h" | |
9 #include "base/path_service.h" | 8 #include "base/path_service.h" |
10 #include "build/build_config.h" | 9 #include "build/build_config.h" |
11 | 10 |
| 11 #if defined(OS_MACOSX) |
| 12 #include "base/mac/bundle_locations.h" |
| 13 #endif |
| 14 |
12 namespace content { | 15 namespace content { |
13 | 16 |
14 bool PathProvider(int key, base::FilePath* result) { | 17 bool PathProvider(int key, base::FilePath* result) { |
15 switch (key) { | 18 switch (key) { |
16 case CHILD_PROCESS_EXE: | 19 case CHILD_PROCESS_EXE: |
17 return PathService::Get(base::FILE_EXE, result); | 20 return PathService::Get(base::FILE_EXE, result); |
18 case DIR_TEST_DATA: { | 21 case DIR_TEST_DATA: { |
19 base::FilePath cur; | 22 base::FilePath cur; |
20 if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur)) | 23 if (!PathService::Get(base::DIR_SOURCE_ROOT, &cur)) |
21 return false; | 24 return false; |
(...skipping 20 matching lines...) Expand all Loading... |
42 } | 45 } |
43 } | 46 } |
44 | 47 |
45 // This cannot be done as a static initializer sadly since Visual Studio will | 48 // This cannot be done as a static initializer sadly since Visual Studio will |
46 // eliminate this object file if there is no direct entry point into it. | 49 // eliminate this object file if there is no direct entry point into it. |
47 void RegisterPathProvider() { | 50 void RegisterPathProvider() { |
48 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 51 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
49 } | 52 } |
50 | 53 |
51 } // namespace content | 54 } // namespace content |
OLD | NEW |