| 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_content_client.h" | 5 #include "chrome/common/chrome_content_client.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/cpu.h" |
| 8 #include "base/debug/crash_logging.h" | 9 #include "base/debug/crash_logging.h" |
| 9 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| 10 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 11 #include "base/strings/string16.h" | 12 #include "base/strings/string16.h" |
| 12 #include "base/strings/string_number_conversions.h" | 13 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/string_split.h" | 14 #include "base/strings/string_split.h" |
| 14 #include "base/strings/string_util.h" | 15 #include "base/strings/string_util.h" |
| 15 #include "base/strings/stringprintf.h" | 16 #include "base/strings/stringprintf.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 17 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 #include "chrome/common/widevine_cdm_constants.h" | 67 #include "chrome/common/widevine_cdm_constants.h" |
| 67 #endif | 68 #endif |
| 68 | 69 |
| 69 namespace { | 70 namespace { |
| 70 | 71 |
| 71 #if defined(ENABLE_PLUGINS) | 72 #if defined(ENABLE_PLUGINS) |
| 72 const char kPDFPluginMimeType[] = "application/pdf"; | 73 const char kPDFPluginMimeType[] = "application/pdf"; |
| 73 const char kPDFPluginExtension[] = "pdf"; | 74 const char kPDFPluginExtension[] = "pdf"; |
| 74 const char kPDFPluginDescription[] = "Portable Document Format"; | 75 const char kPDFPluginDescription[] = "Portable Document Format"; |
| 75 const char kPDFPluginPrintPreviewMimeType[] = | 76 const char kPDFPluginPrintPreviewMimeType[] = |
| 76 "application/x-google-chrome-print-preview-pdf"; | 77 "application/x-google-chrome-print-preview-pdf"; |
| 77 const char kPDFPluginOutOfProcessMimeType[] = | 78 const char kPDFPluginOutOfProcessMimeType[] = |
| 78 "application/x-google-chrome-pdf"; | 79 "application/x-google-chrome-pdf"; |
| 79 const uint32 kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE | | 80 const uint32 kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE | |
| 80 ppapi::PERMISSION_DEV; | 81 ppapi::PERMISSION_DEV; |
| 81 | 82 |
| 82 const char kO1DPluginName[] = "Google Talk Plugin Video Renderer"; | 83 const char kO1DPluginName[] = "Google Talk Plugin Video Renderer"; |
| 83 const char kO1DPluginMimeType[] ="application/o1d"; | 84 const char kO1DPluginMimeType[] ="application/o1d"; |
| 84 const char kO1DPluginExtension[] = ""; | 85 const char kO1DPluginExtension[] = ""; |
| 85 const char kO1DPluginDescription[] = "Google Talk Plugin Video Renderer"; | 86 const char kO1DPluginDescription[] = "Google Talk Plugin Video Renderer"; |
| 86 const uint32 kO1DPluginPermissions = ppapi::PERMISSION_PRIVATE | | 87 const uint32 kO1DPluginPermissions = ppapi::PERMISSION_PRIVATE | |
| 87 ppapi::PERMISSION_DEV; | 88 ppapi::PERMISSION_DEV; |
| 88 | 89 |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 388 // Ignore bundled Pepper Flash if there is Pepper Flash specified from the | 389 // Ignore bundled Pepper Flash if there is Pepper Flash specified from the |
| 389 // command-line. | 390 // command-line. |
| 390 if (command_line->HasSwitch(switches::kPpapiFlashPath)) | 391 if (command_line->HasSwitch(switches::kPpapiFlashPath)) |
| 391 return false; | 392 return false; |
| 392 | 393 |
| 393 bool force_disable = | 394 bool force_disable = |
| 394 command_line->HasSwitch(switches::kDisableBundledPpapiFlash); | 395 command_line->HasSwitch(switches::kDisableBundledPpapiFlash); |
| 395 if (force_disable) | 396 if (force_disable) |
| 396 return false; | 397 return false; |
| 397 | 398 |
| 399 // For Linux ia32, Flapper requires SSE2. |
| 400 #if defined(OS_LINUX) && defined(ARCH_CPU_X86) |
| 401 if (!base::CPU().has_sse2()) |
| 402 return false; |
| 403 #endif // ARCH_CPU_X86 |
| 404 |
| 398 base::FilePath flash_path; | 405 base::FilePath flash_path; |
| 399 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &flash_path)) | 406 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &flash_path)) |
| 400 return false; | 407 return false; |
| 401 | 408 |
| 402 *plugin = CreatePepperFlashInfo(flash_path, FLAPPER_VERSION_STRING); | 409 *plugin = CreatePepperFlashInfo(flash_path, FLAPPER_VERSION_STRING); |
| 403 return true; | 410 return true; |
| 404 #else | 411 #else |
| 405 return false; | 412 return false; |
| 406 #endif // FLAPPER_AVAILABLE | 413 #endif // FLAPPER_AVAILABLE |
| 407 } | 414 } |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 534 int sandbox_type, | 541 int sandbox_type, |
| 535 int* sandbox_profile_resource_id) const { | 542 int* sandbox_profile_resource_id) const { |
| 536 DCHECK(sandbox_profile_resource_id); | 543 DCHECK(sandbox_profile_resource_id); |
| 537 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) { | 544 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) { |
| 538 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; | 545 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; |
| 539 return true; | 546 return true; |
| 540 } | 547 } |
| 541 return false; | 548 return false; |
| 542 } | 549 } |
| 543 #endif | 550 #endif |
| OLD | NEW |