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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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) | 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, Linux only. |
57 const FilePath::CharType kInternalNaClHelperFileName[] = | 57 const FilePath::CharType kInternalNaClHelperFileName[] = |
58 FILE_PATH_LITERAL("nacl_helper"); | |
59 const FilePath::CharType kInternalNaClHelperBootstrapFileName[] = | |
60 FILE_PATH_LITERAL("nacl_helper_bootstrap"); | 58 FILE_PATH_LITERAL("nacl_helper_bootstrap"); |
61 #endif | 59 #endif |
62 | 60 |
63 } // namespace | 61 } // namespace |
64 | 62 |
65 namespace chrome { | 63 namespace chrome { |
66 | 64 |
67 // Gets the path for internal plugins. | 65 // Gets the path for internal plugins. |
68 bool GetInternalPluginsDirectory(FilePath* result) { | 66 bool GetInternalPluginsDirectory(FilePath* result) { |
69 #if defined(OS_MACOSX) | 67 #if defined(OS_MACOSX) |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
241 if (!GetInternalPluginsDirectory(&cur)) | 239 if (!GetInternalPluginsDirectory(&cur)) |
242 return false; | 240 return false; |
243 cur = cur.Append(kInternalNaClPluginFileName); | 241 cur = cur.Append(kInternalNaClPluginFileName); |
244 break; | 242 break; |
245 #if defined(OS_POSIX) && !defined(OS_MACOSX) | 243 #if defined(OS_POSIX) && !defined(OS_MACOSX) |
246 case chrome::FILE_NACL_HELPER: | 244 case chrome::FILE_NACL_HELPER: |
247 if (!PathService::Get(base::DIR_MODULE, &cur)) | 245 if (!PathService::Get(base::DIR_MODULE, &cur)) |
248 return false; | 246 return false; |
249 cur = cur.Append(kInternalNaClHelperFileName); | 247 cur = cur.Append(kInternalNaClHelperFileName); |
250 break; | 248 break; |
251 case chrome::FILE_NACL_HELPER_BOOTSTRAP: | |
252 if (!PathService::Get(base::DIR_MODULE, &cur)) | |
253 return false; | |
254 cur = cur.Append(kInternalNaClHelperBootstrapFileName); | |
255 break; | |
256 #endif | 249 #endif |
257 case chrome::FILE_RESOURCES_PACK: | 250 case chrome::FILE_RESOURCES_PACK: |
258 #if defined(OS_MACOSX) | 251 #if defined(OS_MACOSX) |
259 if (base::mac::AmIBundled()) { | 252 if (base::mac::AmIBundled()) { |
260 cur = base::mac::MainAppBundlePath(); | 253 cur = base::mac::MainAppBundlePath(); |
261 cur = cur.Append(FILE_PATH_LITERAL("Resources")) | 254 cur = cur.Append(FILE_PATH_LITERAL("Resources")) |
262 .Append(FILE_PATH_LITERAL("resources.pak")); | 255 .Append(FILE_PATH_LITERAL("resources.pak")); |
263 break; | 256 break; |
264 } | 257 } |
265 // 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 |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 return true; | 358 return true; |
366 } | 359 } |
367 | 360 |
368 // 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 |
369 // 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. |
370 void RegisterPathProvider() { | 363 void RegisterPathProvider() { |
371 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); | 364 PathService::RegisterProvider(PathProvider, PATH_START, PATH_END); |
372 } | 365 } |
373 | 366 |
374 } // namespace chrome | 367 } // namespace chrome |
OLD | NEW |