| 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 <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 323 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 return true; | 334 return true; |
| 335 } | 335 } |
| 336 LOG(ERROR) | 336 LOG(ERROR) |
| 337 << "Failed to locate and load the component updated flash plugin."; | 337 << "Failed to locate and load the component updated flash plugin."; |
| 338 } | 338 } |
| 339 #endif // defined(FLAPPER_AVAILABLE) | 339 #endif // defined(FLAPPER_AVAILABLE) |
| 340 return false; | 340 return false; |
| 341 } | 341 } |
| 342 #endif // defined(OS_LINUX) | 342 #endif // defined(OS_LINUX) |
| 343 | 343 |
| 344 #if defined(OS_CHROMEOS) | |
| 345 // This should be used on ChromeOS only - other platforms do not bundle Flash. | |
| 346 bool GetBundledPepperFlash(content::PepperPluginInfo* plugin) { | |
| 347 #if defined(FLAPPER_AVAILABLE) | |
| 348 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | |
| 349 | |
| 350 // Ignore bundled Pepper Flash if there is Pepper Flash specified from the | |
| 351 // command-line. | |
| 352 if (command_line->HasSwitch(switches::kPpapiFlashPath)) | |
| 353 return false; | |
| 354 | |
| 355 bool force_disable = | |
| 356 command_line->HasSwitch(switches::kDisableBundledPpapiFlash); | |
| 357 if (force_disable) | |
| 358 return false; | |
| 359 | |
| 360 base::FilePath flash_path; | |
| 361 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &flash_path)) | |
| 362 return false; | |
| 363 | |
| 364 *plugin = CreatePepperFlashInfo(flash_path, FLAPPER_VERSION_STRING, false, | |
| 365 false, true); | |
| 366 return true; | |
| 367 #else | |
| 368 return false; | |
| 369 #endif // FLAPPER_AVAILABLE | |
| 370 } | |
| 371 #endif // defined(OS_CHROMEOS) | |
| 372 | |
| 373 bool GetSystemPepperFlash(content::PepperPluginInfo* plugin) { | 344 bool GetSystemPepperFlash(content::PepperPluginInfo* plugin) { |
| 374 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 345 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 375 // Do not try and find System Pepper Flash if there is a specific path on | 346 // Do not try and find System Pepper Flash if there is a specific path on |
| 376 // the commmand-line. | 347 // the commmand-line. |
| 377 if (command_line->HasSwitch(switches::kPpapiFlashPath)) | 348 if (command_line->HasSwitch(switches::kPpapiFlashPath)) |
| 378 return false; | 349 return false; |
| 379 | 350 |
| 380 base::FilePath flash_filename; | 351 base::FilePath flash_filename; |
| 381 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN, | 352 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN, |
| 382 &flash_filename)) | 353 &flash_filename)) |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 530 | 501 |
| 531 ScopedVector<content::PepperPluginInfo> flash_versions; | 502 ScopedVector<content::PepperPluginInfo> flash_versions; |
| 532 | 503 |
| 533 #if defined(OS_LINUX) | 504 #if defined(OS_LINUX) |
| 534 std::unique_ptr<content::PepperPluginInfo> component_flash( | 505 std::unique_ptr<content::PepperPluginInfo> component_flash( |
| 535 new content::PepperPluginInfo); | 506 new content::PepperPluginInfo); |
| 536 if (GetComponentUpdatedPepperFlash(component_flash.get())) | 507 if (GetComponentUpdatedPepperFlash(component_flash.get())) |
| 537 flash_versions.push_back(component_flash.release()); | 508 flash_versions.push_back(component_flash.release()); |
| 538 #endif // defined(OS_LINUX) | 509 #endif // defined(OS_LINUX) |
| 539 | 510 |
| 540 #if defined(OS_CHROMEOS) | |
| 541 std::unique_ptr<content::PepperPluginInfo> bundled_flash( | |
| 542 new content::PepperPluginInfo); | |
| 543 if (GetBundledPepperFlash(bundled_flash.get())) | |
| 544 flash_versions.push_back(bundled_flash.release()); | |
| 545 #endif // defined(OS_CHROMEOS) | |
| 546 | |
| 547 std::unique_ptr<content::PepperPluginInfo> system_flash( | 511 std::unique_ptr<content::PepperPluginInfo> system_flash( |
| 548 new content::PepperPluginInfo); | 512 new content::PepperPluginInfo); |
| 549 if (GetSystemPepperFlash(system_flash.get())) | 513 if (GetSystemPepperFlash(system_flash.get())) |
| 550 flash_versions.push_back(system_flash.release()); | 514 flash_versions.push_back(system_flash.release()); |
| 551 | 515 |
| 552 // This function will return only the most recent version of the flash plugin. | 516 // This function will return only the most recent version of the flash plugin. |
| 553 content::PepperPluginInfo* max_flash = | 517 content::PepperPluginInfo* max_flash = |
| 554 FindMostRecentPlugin(flash_versions.get()); | 518 FindMostRecentPlugin(flash_versions.get()); |
| 555 if (max_flash) { | 519 if (max_flash) { |
| 556 plugins->push_back(*max_flash); | 520 plugins->push_back(*max_flash); |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 730 origin_trial_policy_ = base::WrapUnique(new ChromeOriginTrialPolicy()); | 694 origin_trial_policy_ = base::WrapUnique(new ChromeOriginTrialPolicy()); |
| 731 } | 695 } |
| 732 return origin_trial_policy_.get(); | 696 return origin_trial_policy_.get(); |
| 733 } | 697 } |
| 734 | 698 |
| 735 #if defined(OS_ANDROID) | 699 #if defined(OS_ANDROID) |
| 736 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { | 700 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { |
| 737 return new ChromeMediaClientAndroid(); | 701 return new ChromeMediaClientAndroid(); |
| 738 } | 702 } |
| 739 #endif // OS_ANDROID | 703 #endif // OS_ANDROID |
| OLD | NEW |