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 | |
63 const base::FilePath::CharType kInternalNaClPluginFileName[] = | 53 const base::FilePath::CharType kInternalNaClPluginFileName[] = |
64 FILE_PATH_LITERAL("internal-nacl-plugin"); | 54 FILE_PATH_LITERAL("internal-nacl-plugin"); |
65 | 55 |
66 const base::FilePath::CharType kEffectsPluginFileName[] = | 56 const base::FilePath::CharType kEffectsPluginFileName[] = |
67 #if defined(OS_WIN) | 57 #if defined(OS_WIN) |
68 FILE_PATH_LITERAL("pepper/libppeffects.dll"); | 58 FILE_PATH_LITERAL("pepper/libppeffects.dll"); |
69 #elif defined(OS_MACOSX) | 59 #elif defined(OS_MACOSX) |
70 FILE_PATH_LITERAL("pepper/libppeffects.plugin"); | 60 FILE_PATH_LITERAL("pepper/libppeffects.plugin"); |
71 #else // Linux and Chrome OS | 61 #else // Linux and Chrome OS |
72 FILE_PATH_LITERAL("pepper/libppeffects.so"); | 62 FILE_PATH_LITERAL("pepper/libppeffects.so"); |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
287 case chrome::FILE_FLASH_PLUGIN: | 277 case chrome::FILE_FLASH_PLUGIN: |
288 if (!GetInternalPluginsDirectory(&cur)) | 278 if (!GetInternalPluginsDirectory(&cur)) |
289 return false; | 279 return false; |
290 cur = cur.Append(kInternalFlashPluginFileName); | 280 cur = cur.Append(kInternalFlashPluginFileName); |
291 break; | 281 break; |
292 case chrome::FILE_PEPPER_FLASH_PLUGIN: | 282 case chrome::FILE_PEPPER_FLASH_PLUGIN: |
293 if (!PathService::Get(chrome::DIR_PEPPER_FLASH_PLUGIN, &cur)) | 283 if (!PathService::Get(chrome::DIR_PEPPER_FLASH_PLUGIN, &cur)) |
294 return false; | 284 return false; |
295 cur = cur.Append(chrome::kPepperFlashPluginFilename); | 285 cur = cur.Append(chrome::kPepperFlashPluginFilename); |
296 break; | 286 break; |
297 case chrome::FILE_PDF_PLUGIN: | |
298 if (!GetInternalPluginsDirectory(&cur)) | |
299 return false; | |
300 cur = cur.Append(kInternalPDFPluginFileName); | |
301 break; | |
302 case chrome::FILE_EFFECTS_PLUGIN: | 287 case chrome::FILE_EFFECTS_PLUGIN: |
303 if (!GetInternalPluginsDirectory(&cur)) | 288 if (!GetInternalPluginsDirectory(&cur)) |
304 return false; | 289 return false; |
305 cur = cur.Append(kEffectsPluginFileName); | 290 cur = cur.Append(kEffectsPluginFileName); |
306 break; | 291 break; |
307 // TODO(teravest): Remove this case once the internal NaCl plugin is gone. | 292 // TODO(teravest): Remove this case once the internal NaCl plugin is gone. |
308 // We currently need a path here to look up whether the plugin is disabled | 293 // We currently need a path here to look up whether the plugin is disabled |
309 // and what its permissions are. | 294 // and what its permissions are. |
310 case chrome::FILE_NACL_PLUGIN: | 295 case chrome::FILE_NACL_PLUGIN: |
311 if (!GetInternalPluginsDirectory(&cur)) | 296 if (!GetInternalPluginsDirectory(&cur)) |
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
587 | 572 |
588 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { | 573 void SetInvalidSpecifiedUserDataDir(const base::FilePath& user_data_dir) { |
589 g_invalid_specified_user_data_dir.Get() = user_data_dir; | 574 g_invalid_specified_user_data_dir.Get() = user_data_dir; |
590 } | 575 } |
591 | 576 |
592 const base::FilePath& GetInvalidSpecifiedUserDataDir() { | 577 const base::FilePath& GetInvalidSpecifiedUserDataDir() { |
593 return g_invalid_specified_user_data_dir.Get(); | 578 return g_invalid_specified_user_data_dir.Get(); |
594 } | 579 } |
595 | 580 |
596 } // namespace chrome | 581 } // namespace chrome |
OLD | NEW |