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