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" | |
9 #include "base/debug/crash_logging.h" | 8 #include "base/debug/crash_logging.h" |
10 #include "base/file_util.h" | 9 #include "base/file_util.h" |
11 #include "base/path_service.h" | 10 #include "base/path_service.h" |
12 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
13 #include "base/strings/string_number_conversions.h" | 12 #include "base/strings/string_number_conversions.h" |
14 #include "base/strings/string_split.h" | 13 #include "base/strings/string_split.h" |
15 #include "base/strings/string_util.h" | 14 #include "base/strings/string_util.h" |
16 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
17 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
18 #include "build/build_config.h" | 17 #include "build/build_config.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 !defined(WIDEVINE_CDM_IS_COMPONENT) | 60 !defined(WIDEVINE_CDM_IS_COMPONENT) |
62 #include "chrome/common/widevine_cdm_constants.h" | 61 #include "chrome/common/widevine_cdm_constants.h" |
63 #endif | 62 #endif |
64 | 63 |
65 namespace { | 64 namespace { |
66 | 65 |
67 const char kPDFPluginMimeType[] = "application/pdf"; | 66 const char kPDFPluginMimeType[] = "application/pdf"; |
68 const char kPDFPluginExtension[] = "pdf"; | 67 const char kPDFPluginExtension[] = "pdf"; |
69 const char kPDFPluginDescription[] = "Portable Document Format"; | 68 const char kPDFPluginDescription[] = "Portable Document Format"; |
70 const char kPDFPluginPrintPreviewMimeType[] = | 69 const char kPDFPluginPrintPreviewMimeType[] = |
71 "application/x-google-chrome-print-preview-pdf"; | 70 "application/x-google-chrome-print-preview-pdf"; |
72 const char kPDFPluginOutOfProcessMimeType[] = | 71 const char kPDFPluginOutOfProcessMimeType[] = |
73 "application/x-google-chrome-pdf"; | 72 "application/x-google-chrome-pdf"; |
74 const uint32 kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE | | 73 const uint32 kPDFPluginPermissions = ppapi::PERMISSION_PRIVATE | |
75 ppapi::PERMISSION_DEV; | 74 ppapi::PERMISSION_DEV; |
76 | 75 |
77 #if !defined(DISABLE_NACL) | 76 #if !defined(DISABLE_NACL) |
78 const char kNaClPluginMimeType[] = "application/x-nacl"; | 77 const char kNaClPluginMimeType[] = "application/x-nacl"; |
79 const char kNaClPluginExtension[] = ""; | 78 const char kNaClPluginExtension[] = ""; |
80 const char kNaClPluginDescription[] = "Native Client Executable"; | 79 const char kNaClPluginDescription[] = "Native Client Executable"; |
81 const uint32 kNaClPluginPermissions = ppapi::PERMISSION_PRIVATE | | 80 const uint32 kNaClPluginPermissions = ppapi::PERMISSION_PRIVATE | |
82 ppapi::PERMISSION_DEV; | 81 ppapi::PERMISSION_DEV; |
83 | 82 |
(...skipping 311 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 // Ignore bundled Pepper Flash if there is Pepper Flash specified from the | 394 // Ignore bundled Pepper Flash if there is Pepper Flash specified from the |
396 // command-line. | 395 // command-line. |
397 if (command_line->HasSwitch(switches::kPpapiFlashPath)) | 396 if (command_line->HasSwitch(switches::kPpapiFlashPath)) |
398 return false; | 397 return false; |
399 | 398 |
400 bool force_disable = | 399 bool force_disable = |
401 command_line->HasSwitch(switches::kDisableBundledPpapiFlash); | 400 command_line->HasSwitch(switches::kDisableBundledPpapiFlash); |
402 if (force_disable) | 401 if (force_disable) |
403 return false; | 402 return false; |
404 | 403 |
405 // For Linux ia32, Flapper requires SSE2. | |
406 #if defined(OS_LINUX) && defined(ARCH_CPU_X86) | |
407 if (!base::CPU().has_sse2()) | |
408 return false; | |
409 #endif // ARCH_CPU_X86 | |
410 | |
411 base::FilePath flash_path; | 404 base::FilePath flash_path; |
412 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &flash_path)) | 405 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &flash_path)) |
413 return false; | 406 return false; |
414 | 407 |
415 *plugin = CreatePepperFlashInfo(flash_path, FLAPPER_VERSION_STRING); | 408 *plugin = CreatePepperFlashInfo(flash_path, FLAPPER_VERSION_STRING); |
416 return true; | 409 return true; |
417 #else | 410 #else |
418 return false; | 411 return false; |
419 #endif // FLAPPER_AVAILABLE | 412 #endif // FLAPPER_AVAILABLE |
420 } | 413 } |
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
538 int sandbox_type, | 531 int sandbox_type, |
539 int* sandbox_profile_resource_id) const { | 532 int* sandbox_profile_resource_id) const { |
540 DCHECK(sandbox_profile_resource_id); | 533 DCHECK(sandbox_profile_resource_id); |
541 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) { | 534 if (sandbox_type == NACL_SANDBOX_TYPE_NACL_LOADER) { |
542 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; | 535 *sandbox_profile_resource_id = IDR_NACL_SANDBOX_PROFILE; |
543 return true; | 536 return true; |
544 } | 537 } |
545 return false; | 538 return false; |
546 } | 539 } |
547 #endif | 540 #endif |
OLD | NEW |