OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/lazy_instance.h" | 8 #include "base/lazy_instance.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/mac/bundle_locations.h" | 10 #include "base/mac/bundle_locations.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 | 43 |
44 // The Pepper Flash plugins are in a directory with this name. | 44 // The Pepper Flash plugins are in a directory with this name. |
45 const base::FilePath::CharType kPepperFlashBaseDirectory[] = | 45 const base::FilePath::CharType kPepperFlashBaseDirectory[] = |
46 FILE_PATH_LITERAL("PepperFlash"); | 46 FILE_PATH_LITERAL("PepperFlash"); |
47 | 47 |
48 #if defined(OS_WIN) | 48 #if defined(OS_WIN) |
49 const base::FilePath::CharType kPepperFlashDebuggerBaseDirectory[] = | 49 const base::FilePath::CharType kPepperFlashDebuggerBaseDirectory[] = |
50 FILE_PATH_LITERAL("Macromed\\Flash"); | 50 FILE_PATH_LITERAL("Macromed\\Flash"); |
51 #endif | 51 #endif |
52 | 52 |
| 53 // File name of the internal PDF plugin on different platforms. |
| 54 const base::FilePath::CharType kInternalPDFPluginFileName[] = |
| 55 #if defined(OS_WIN) |
| 56 FILE_PATH_LITERAL("pdf.dll"); |
| 57 #elif defined(OS_MACOSX) |
| 58 FILE_PATH_LITERAL("PDF.plugin"); |
| 59 #else // Linux and Chrome OS |
| 60 FILE_PATH_LITERAL("libpdf.so"); |
| 61 #endif |
| 62 |
53 const base::FilePath::CharType kInternalNaClPluginFileName[] = | 63 const base::FilePath::CharType kInternalNaClPluginFileName[] = |
54 FILE_PATH_LITERAL("internal-nacl-plugin"); | 64 FILE_PATH_LITERAL("internal-nacl-plugin"); |
55 | 65 |
56 const base::FilePath::CharType kEffectsPluginFileName[] = | 66 const base::FilePath::CharType kEffectsPluginFileName[] = |
57 #if defined(OS_WIN) | 67 #if defined(OS_WIN) |
58 FILE_PATH_LITERAL("pepper/libppeffects.dll"); | 68 FILE_PATH_LITERAL("pepper/libppeffects.dll"); |
59 #elif defined(OS_MACOSX) | 69 #elif defined(OS_MACOSX) |
60 FILE_PATH_LITERAL("pepper/libppeffects.plugin"); | 70 FILE_PATH_LITERAL("pepper/libppeffects.plugin"); |
61 #else // Linux and Chrome OS | 71 #else // Linux and Chrome OS |
62 FILE_PATH_LITERAL("pepper/libppeffects.so"); | 72 FILE_PATH_LITERAL("pepper/libppeffects.so"); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 case chrome::FILE_FLASH_PLUGIN: | 287 case chrome::FILE_FLASH_PLUGIN: |
278 if (!GetInternalPluginsDirectory(&cur)) | 288 if (!GetInternalPluginsDirectory(&cur)) |
279 return false; | 289 return false; |
280 cur = cur.Append(kInternalFlashPluginFileName); | 290 cur = cur.Append(kInternalFlashPluginFileName); |
281 break; | 291 break; |
282 case chrome::FILE_PEPPER_FLASH_PLUGIN: | 292 case chrome::FILE_PEPPER_FLASH_PLUGIN: |
283 if (!PathService::Get(chrome::DIR_PEPPER_FLASH_PLUGIN, &cur)) | 293 if (!PathService::Get(chrome::DIR_PEPPER_FLASH_PLUGIN, &cur)) |
284 return false; | 294 return false; |
285 cur = cur.Append(chrome::kPepperFlashPluginFilename); | 295 cur = cur.Append(chrome::kPepperFlashPluginFilename); |
286 break; | 296 break; |
| 297 case chrome::FILE_PDF_PLUGIN: |
| 298 if (!GetInternalPluginsDirectory(&cur)) |
| 299 return false; |
| 300 cur = cur.Append(kInternalPDFPluginFileName); |
| 301 break; |
287 case chrome::FILE_EFFECTS_PLUGIN: | 302 case chrome::FILE_EFFECTS_PLUGIN: |
288 if (!GetInternalPluginsDirectory(&cur)) | 303 if (!GetInternalPluginsDirectory(&cur)) |
289 return false; | 304 return false; |
290 cur = cur.Append(kEffectsPluginFileName); | 305 cur = cur.Append(kEffectsPluginFileName); |
291 break; | 306 break; |
292 // TODO(teravest): Remove this case once the internal NaCl plugin is gone. | 307 // TODO(teravest): Remove this case once the internal NaCl plugin is gone. |
293 // We currently need a path here to look up whether the plugin is disabled | 308 // We currently need a path here to look up whether the plugin is disabled |
294 // and what its permissions are. | 309 // and what its permissions are. |
295 case chrome::FILE_NACL_PLUGIN: | 310 case chrome::FILE_NACL_PLUGIN: |
296 if (!GetInternalPluginsDirectory(&cur)) | 311 if (!GetInternalPluginsDirectory(&cur)) |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 | 587 |
573 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { | 588 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { |
574 g_invalid_specified_user_data_dir.Get() = user_data_dir; | 589 g_invalid_specified_user_data_dir.Get() = user_data_dir; |
575 } | 590 } |
576 | 591 |
577 const base::FilePath& GetInvalidSpecifiedUserDataDir() { | 592 const base::FilePath& GetInvalidSpecifiedUserDataDir() { |
578 return g_invalid_specified_user_data_dir.Get(); | 593 return g_invalid_specified_user_data_dir.Get(); |
579 } | 594 } |
580 | 595 |
581 } // namespace chrome | 596 } // namespace chrome |
OLD | NEW |