OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/common/chrome_paths.h" | 5 #include "chrome/common/chrome_paths.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
188 break; | 188 break; |
189 case chrome::DIR_USER_DATA_TEMP: | 189 case chrome::DIR_USER_DATA_TEMP: |
190 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 190 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
191 return false; | 191 return false; |
192 cur = cur.Append(FILE_PATH_LITERAL("Temp")); | 192 cur = cur.Append(FILE_PATH_LITERAL("Temp")); |
193 break; | 193 break; |
194 case chrome::DIR_INTERNAL_PLUGINS: | 194 case chrome::DIR_INTERNAL_PLUGINS: |
195 if (!GetInternalPluginsDirectory(&cur)) | 195 if (!GetInternalPluginsDirectory(&cur)) |
196 return false; | 196 return false; |
197 break; | 197 break; |
| 198 case chrome::DIR_MEDIA_LIBS: |
| 199 #if defined(OS_MACOSX) |
| 200 *result = base::mac::MainAppBundlePath(); |
| 201 *result = result->Append("Libraries"); |
| 202 return true; |
| 203 #else |
| 204 return PathService::Get(chrome::DIR_APP, result); |
| 205 #endif |
198 case chrome::FILE_LOCAL_STATE: | 206 case chrome::FILE_LOCAL_STATE: |
199 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 207 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
200 return false; | 208 return false; |
201 cur = cur.Append(chrome::kLocalStateFilename); | 209 cur = cur.Append(chrome::kLocalStateFilename); |
202 break; | 210 break; |
203 case chrome::FILE_RECORDED_SCRIPT: | 211 case chrome::FILE_RECORDED_SCRIPT: |
204 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) | 212 if (!PathService::Get(chrome::DIR_USER_DATA, &cur)) |
205 return false; | 213 return false; |
206 cur = cur.Append(FILE_PATH_LITERAL("script.log")); | 214 cur = cur.Append(FILE_PATH_LITERAL("script.log")); |
207 break; | 215 break; |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
312 return true; | 320 return true; |
313 } | 321 } |
314 | 322 |
315 // This cannot be done as a static initializer sadly since Visual Studio will | 323 // This cannot be done as a static initializer sadly since Visual Studio will |
316 // eliminate this object file if there is no direct entry point into it. | 324 // eliminate this object file if there is no direct entry point into it. |
317 void RegisterPathProvider() { | 325 void RegisterPathProvider() { |
318 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 326 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
319 } | 327 } |
320 | 328 |
321 } // namespace chrome | 329 } // namespace chrome |
OLD | NEW |