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 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
53 #endif | 53 #endif |
54 | 54 |
55 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 55 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
56 // File name of the nacl_helper and nacl_helper_bootstrap, Linux only. | 56 // File name of the nacl_helper and nacl_helper_bootstrap, Linux only. |
57 const FilePath::CharType kInternalNaClHelperFileName[] = | 57 const FilePath::CharType kInternalNaClHelperFileName[] = |
58 FILE_PATH_LITERAL("nacl_helper"); | 58 FILE_PATH_LITERAL("nacl_helper"); |
59 const FilePath::CharType kInternalNaClHelperBootstrapFileName[] = | 59 const FilePath::CharType kInternalNaClHelperBootstrapFileName[] = |
60 FILE_PATH_LITERAL("nacl_helper_bootstrap"); | 60 FILE_PATH_LITERAL("nacl_helper_bootstrap"); |
61 #endif | 61 #endif |
62 | 62 |
63 | |
64 #if defined(OS_POSIX) && !defined(OS_MACOSX) | |
65 | |
66 #if defined(OS_CHROMEOS) | |
67 | |
68 const FilePath::CharType kO3DPluginFileName[] = | |
69 FILE_PATH_LITERAL("/opt/google/o3d/libppo3dautoplugin.so"); | |
piman
2011/12/13 01:48:02
Do we need a different path on Chrome OS vs non-Ch
Josh Horwich
2011/12/13 22:06:30
Done - I moved it to the pepper directory on all L
| |
70 | |
71 const FilePath::CharType kGTalkPluginFileName[] = | |
72 FILE_PATH_LITERAL("/opt/google/talkplugin/libppgoogletalk.so"); | |
73 | |
74 #else // defined(OS_CHROMEOS) | |
75 | |
76 // File name of the O3D and GTalk plugin, Linux only | |
77 const FilePath::CharType kO3DPluginFileName[] = | |
78 FILE_PATH_LITERAL("libppo3dautoplugin.so"); | |
79 | |
80 const FilePath::CharType kGTalkPluginFileName[] = | |
81 FILE_PATH_LITERAL("libppgoogletalk.so"); | |
82 | |
83 #endif // defined(OS_CHROMEOS) | |
84 | |
85 #endif // defined(OS_POSIX) && !defined(OS_MACOSX) | |
63 } // namespace | 86 } // namespace |
64 | 87 |
65 namespace chrome { | 88 namespace chrome { |
66 | 89 |
67 // Gets the path for internal plugins. | 90 // Gets the path for internal plugins. |
68 bool GetInternalPluginsDirectory(FilePath* result) { | 91 bool GetInternalPluginsDirectory(FilePath* result) { |
69 #if defined(OS_MACOSX) | 92 #if defined(OS_MACOSX) |
70 // If called from Chrome, get internal plugins from a subdirectory of the | 93 // If called from Chrome, get internal plugins from a subdirectory of the |
71 // framework. | 94 // framework. |
72 if (base::mac::AmIBundled()) { | 95 if (base::mac::AmIBundled()) { |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
246 case chrome::FILE_NACL_HELPER: | 269 case chrome::FILE_NACL_HELPER: |
247 if (!PathService::Get(base::DIR_MODULE, &cur)) | 270 if (!PathService::Get(base::DIR_MODULE, &cur)) |
248 return false; | 271 return false; |
249 cur = cur.Append(kInternalNaClHelperFileName); | 272 cur = cur.Append(kInternalNaClHelperFileName); |
250 break; | 273 break; |
251 case chrome::FILE_NACL_HELPER_BOOTSTRAP: | 274 case chrome::FILE_NACL_HELPER_BOOTSTRAP: |
252 if (!PathService::Get(base::DIR_MODULE, &cur)) | 275 if (!PathService::Get(base::DIR_MODULE, &cur)) |
253 return false; | 276 return false; |
254 cur = cur.Append(kInternalNaClHelperBootstrapFileName); | 277 cur = cur.Append(kInternalNaClHelperBootstrapFileName); |
255 break; | 278 break; |
279 case chrome::FILE_O3D_PLUGIN: | |
280 #if defined(OS_CHROMEOS) | |
281 cur = FilePath(kO3DPluginFileName); | |
282 #else // defined(OS_CHROMEOS) | |
283 if (!GetInternalPluginsDirectory(&cur)) | |
284 return false; | |
285 cur = cur.Append(kO3DPluginFileName); | |
286 #endif // OS_CHROMEOS | |
287 break; | |
288 case chrome::FILE_GTALK_PLUGIN: | |
289 #if defined(OS_CHROMEOS) | |
290 cur = FilePath(kGTalkPluginFileName); | |
291 #else // defined(OS_CHROMEOS) | |
292 if (!GetInternalPluginsDirectory(&cur)) | |
293 return false; | |
294 cur = cur.Append(kGTalkPluginFileName); | |
295 #endif // OS_CHROMEOS | |
296 break; | |
256 #endif | 297 #endif |
257 case chrome::FILE_RESOURCES_PACK: | 298 case chrome::FILE_RESOURCES_PACK: |
258 #if defined(OS_MACOSX) | 299 #if defined(OS_MACOSX) |
259 if (base::mac::AmIBundled()) { | 300 if (base::mac::AmIBundled()) { |
260 cur = base::mac::MainAppBundlePath(); | 301 cur = base::mac::MainAppBundlePath(); |
261 cur = cur.Append(FILE_PATH_LITERAL("Resources")) | 302 cur = cur.Append(FILE_PATH_LITERAL("Resources")) |
262 .Append(FILE_PATH_LITERAL("resources.pak")); | 303 .Append(FILE_PATH_LITERAL("resources.pak")); |
263 break; | 304 break; |
264 } | 305 } |
265 // If we're not bundled on mac, resources.pak should be next to the | 306 // If we're not bundled on mac, resources.pak should be next to the |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
406 return true; | 447 return true; |
407 } | 448 } |
408 | 449 |
409 // This cannot be done as a static initializer sadly since Visual Studio will | 450 // This cannot be done as a static initializer sadly since Visual Studio will |
410 // eliminate this object file if there is no direct entry point into it. | 451 // eliminate this object file if there is no direct entry point into it. |
411 void RegisterPathProvider() { | 452 void RegisterPathProvider() { |
412 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 453 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
413 } | 454 } |
414 | 455 |
415 } // namespace chrome | 456 } // namespace chrome |
OLD | NEW |