| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 const FilePath::CharType kInternalNaClPluginFileName[] = | 45 const FilePath::CharType kInternalNaClPluginFileName[] = |
| 46 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
| 47 FILE_PATH_LITERAL("ppGoogleNaClPluginChrome.dll"); | 47 FILE_PATH_LITERAL("ppGoogleNaClPluginChrome.dll"); |
| 48 #elif defined(OS_MACOSX) | 48 #elif defined(OS_MACOSX) |
| 49 // TODO(noelallen) Please verify this extention name is correct. | 49 // TODO(noelallen) Please verify this extention name is correct. |
| 50 FILE_PATH_LITERAL("ppGoogleNaClPluginChrome.plugin"); | 50 FILE_PATH_LITERAL("ppGoogleNaClPluginChrome.plugin"); |
| 51 #else // Linux and Chrome OS | 51 #else // Linux and Chrome OS |
| 52 FILE_PATH_LITERAL("libppGoogleNaClPluginChrome.so"); | 52 FILE_PATH_LITERAL("libppGoogleNaClPluginChrome.so"); |
| 53 #endif | 53 #endif |
| 54 | 54 |
| 55 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 56 // File name of the nacl_helper, Linux only. |
| 57 const FilePath::CharType kInternalNaClHelperFileName[] = |
| 58 FILE_PATH_LITERAL("nacl_helper_bootstrap"); |
| 59 #endif |
| 60 |
| 55 } // namespace | 61 } // namespace |
| 56 | 62 |
| 57 namespace chrome { | 63 namespace chrome { |
| 58 | 64 |
| 59 // Gets the path for internal plugins. | 65 // Gets the path for internal plugins. |
| 60 bool GetInternalPluginsDirectory(FilePath* result) { | 66 bool GetInternalPluginsDirectory(FilePath* result) { |
| 61 #if defined(OS_MACOSX) | 67 #if defined(OS_MACOSX) |
| 62 // If called from Chrome, get internal plugins from a subdirectory of the | 68 // If called from Chrome, get internal plugins from a subdirectory of the |
| 63 // framework. | 69 // framework. |
| 64 if (base::mac::AmIBundled()) { | 70 if (base::mac::AmIBundled()) { |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 case chrome::FILE_PDF_PLUGIN: | 233 case chrome::FILE_PDF_PLUGIN: |
| 228 if (!GetInternalPluginsDirectory(&cur)) | 234 if (!GetInternalPluginsDirectory(&cur)) |
| 229 return false; | 235 return false; |
| 230 cur = cur.Append(kInternalPDFPluginFileName); | 236 cur = cur.Append(kInternalPDFPluginFileName); |
| 231 break; | 237 break; |
| 232 case chrome::FILE_NACL_PLUGIN: | 238 case chrome::FILE_NACL_PLUGIN: |
| 233 if (!GetInternalPluginsDirectory(&cur)) | 239 if (!GetInternalPluginsDirectory(&cur)) |
| 234 return false; | 240 return false; |
| 235 cur = cur.Append(kInternalNaClPluginFileName); | 241 cur = cur.Append(kInternalNaClPluginFileName); |
| 236 break; | 242 break; |
| 243 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
| 244 case chrome::FILE_NACL_HELPER: |
| 245 if (!PathService::Get(base::DIR_MODULE, &cur)) |
| 246 return false; |
| 247 cur = cur.Append(kInternalNaClHelperFileName); |
| 248 break; |
| 249 #endif |
| 237 case chrome::FILE_RESOURCES_PACK: | 250 case chrome::FILE_RESOURCES_PACK: |
| 238 #if defined(OS_MACOSX) | 251 #if defined(OS_MACOSX) |
| 239 if (base::mac::AmIBundled()) { | 252 if (base::mac::AmIBundled()) { |
| 240 cur = base::mac::MainAppBundlePath(); | 253 cur = base::mac::MainAppBundlePath(); |
| 241 cur = cur.Append(FILE_PATH_LITERAL("Resources")) | 254 cur = cur.Append(FILE_PATH_LITERAL("Resources")) |
| 242 .Append(FILE_PATH_LITERAL("resources.pak")); | 255 .Append(FILE_PATH_LITERAL("resources.pak")); |
| 243 break; | 256 break; |
| 244 } | 257 } |
| 245 // If we're not bundled on mac, resources.pak should be next to the | 258 // If we're not bundled on mac, resources.pak should be next to the |
| 246 // binary (e.g., for unit tests). | 259 // binary (e.g., for unit tests). |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 return true; | 358 return true; |
| 346 } | 359 } |
| 347 | 360 |
| 348 // This cannot be done as a static initializer sadly since Visual Studio will | 361 // This cannot be done as a static initializer sadly since Visual Studio will |
| 349 // eliminate this object file if there is no direct entry point into it. | 362 // eliminate this object file if there is no direct entry point into it. |
| 350 void RegisterPathProvider() { | 363 void RegisterPathProvider() { |
| 351 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 364 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
| 352 } | 365 } |
| 353 | 366 |
| 354 } // namespace chrome | 367 } // namespace chrome |
| OLD | NEW |