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/cpu.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "content/public/common/url_constants.h" | 27 #include "content/public/common/url_constants.h" |
28 #include "extensions/common/constants.h" | 28 #include "extensions/common/constants.h" |
29 #include "grit/common_resources.h" | 29 #include "grit/common_resources.h" |
30 #include "ppapi/shared_impl/ppapi_permissions.h" | 30 #include "ppapi/shared_impl/ppapi_permissions.h" |
31 #include "remoting/client/plugin/pepper_entrypoints.h" | 31 #include "remoting/client/plugin/pepper_entrypoints.h" |
32 #include "ui/base/l10n/l10n_util.h" | 32 #include "ui/base/l10n/l10n_util.h" |
33 #include "ui/base/layout.h" | 33 #include "ui/base/layout.h" |
34 #include "ui/base/resource/resource_bundle.h" | 34 #include "ui/base/resource/resource_bundle.h" |
35 #include "webkit/plugins/npapi/plugin_list.h" | 35 #include "webkit/plugins/npapi/plugin_list.h" |
36 #include "webkit/plugins/plugin_constants.h" | 36 #include "webkit/plugins/plugin_constants.h" |
| 37 #include "webkit/plugins/plugin_switches.h" |
37 #include "webkit/user_agent/user_agent_util.h" | 38 #include "webkit/user_agent/user_agent_util.h" |
38 | 39 |
39 #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR. | 40 #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR. |
40 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. | 41 #include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. |
41 | 42 |
42 #if defined(OS_WIN) | 43 #if defined(OS_WIN) |
43 #include "base/win/registry.h" | 44 #include "base/win/registry.h" |
44 #include "base/win/windows_version.h" | 45 #include "base/win/windows_version.h" |
45 #include "sandbox/win/src/sandbox.h" | 46 #include "sandbox/win/src/sandbox.h" |
46 #elif defined(OS_MACOSX) | 47 #elif defined(OS_MACOSX) |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 std::string flash_version = | 307 std::string flash_version = |
307 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 308 CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
308 switches::kPpapiFlashVersion); | 309 switches::kPpapiFlashVersion); |
309 | 310 |
310 plugins->push_back( | 311 plugins->push_back( |
311 CreatePepperFlashInfo(FilePath(flash_path), flash_version)); | 312 CreatePepperFlashInfo(FilePath(flash_path), flash_version)); |
312 } | 313 } |
313 | 314 |
314 bool GetBundledPepperFlash(content::PepperPluginInfo* plugin, | 315 bool GetBundledPepperFlash(content::PepperPluginInfo* plugin, |
315 bool* override_npapi_flash) { | 316 bool* override_npapi_flash) { |
| 317 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
| 318 if (!command_line->HasSwitch(switches::kDisablePepperThreading) && |
| 319 !command_line->HasSwitch(switches::kEnablePepperThreading)) { |
| 320 chrome::VersionInfo::Channel channel = chrome::VersionInfo::GetChannel(); |
| 321 if (channel == chrome::VersionInfo::CHANNEL_CANARY) |
| 322 command_line->AppendSwitch(switches::kEnablePepperThreading); |
| 323 } |
| 324 |
316 #if defined(FLAPPER_AVAILABLE) | 325 #if defined(FLAPPER_AVAILABLE) |
317 // Ignore bundled Pepper Flash if there is Pepper Flash specified from the | 326 // Ignore bundled Pepper Flash if there is Pepper Flash specified from the |
318 // command-line. | 327 // command-line. |
319 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kPpapiFlashPath)) | 328 if (command_line->HasSwitch(switches::kPpapiFlashPath)) |
320 return false; | 329 return false; |
321 | 330 |
322 bool force_disable = CommandLine::ForCurrentProcess()->HasSwitch( | 331 bool force_disable = |
323 switches::kDisableBundledPpapiFlash); | 332 command_line->HasSwitch(switches::kDisableBundledPpapiFlash); |
324 if (force_disable) | 333 if (force_disable) |
325 return false; | 334 return false; |
326 | 335 |
327 // For Linux ia32, Flapper requires SSE2. | 336 // For Linux ia32, Flapper requires SSE2. |
328 #if defined(OS_LINUX) && defined(ARCH_CPU_X86) | 337 #if defined(OS_LINUX) && defined(ARCH_CPU_X86) |
329 if (!base::CPU().has_sse2()) | 338 if (!base::CPU().has_sse2()) |
330 return false; | 339 return false; |
331 #endif // ARCH_CPU_X86 | 340 #endif // ARCH_CPU_X86 |
332 | 341 |
333 FilePath flash_path; | 342 FilePath flash_path; |
334 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &flash_path)) | 343 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &flash_path)) |
335 return false; | 344 return false; |
336 | 345 |
337 bool force_enable = CommandLine::ForCurrentProcess()->HasSwitch( | 346 bool force_enable = |
338 switches::kEnableBundledPpapiFlash); | 347 command_line->HasSwitch(switches::kEnableBundledPpapiFlash); |
339 | 348 |
340 *plugin = CreatePepperFlashInfo(flash_path, FLAPPER_VERSION_STRING); | 349 *plugin = CreatePepperFlashInfo(flash_path, FLAPPER_VERSION_STRING); |
341 *override_npapi_flash = force_enable || IsPepperFlashEnabledByDefault(); | 350 *override_npapi_flash = force_enable || IsPepperFlashEnabledByDefault(); |
342 return true; | 351 return true; |
343 #else | 352 #else |
344 return false; | 353 return false; |
345 #endif // FLAPPER_AVAILABLE | 354 #endif // FLAPPER_AVAILABLE |
346 } | 355 } |
347 | 356 |
348 } // namespace | 357 } // namespace |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 | 473 |
465 bool ChromeContentClient::GetBundledFieldTrialPepperFlash( | 474 bool ChromeContentClient::GetBundledFieldTrialPepperFlash( |
466 content::PepperPluginInfo* plugin, | 475 content::PepperPluginInfo* plugin, |
467 bool* override_npapi_flash) { | 476 bool* override_npapi_flash) { |
468 if (!ConductingPepperFlashFieldTrial()) | 477 if (!ConductingPepperFlashFieldTrial()) |
469 return false; | 478 return false; |
470 return GetBundledPepperFlash(plugin, override_npapi_flash); | 479 return GetBundledPepperFlash(plugin, override_npapi_flash); |
471 } | 480 } |
472 | 481 |
473 } // namespace chrome | 482 } // namespace chrome |
OLD | NEW |