| 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 <memory> | 9 #include <memory> |
| 10 #include <tuple> | 10 #include <tuple> |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 return true; | 333 return true; |
| 334 } | 334 } |
| 335 LOG(ERROR) | 335 LOG(ERROR) |
| 336 << "Failed to locate and load the component updated flash plugin."; | 336 << "Failed to locate and load the component updated flash plugin."; |
| 337 } | 337 } |
| 338 #endif // defined(FLAPPER_AVAILABLE) | 338 #endif // defined(FLAPPER_AVAILABLE) |
| 339 return false; | 339 return false; |
| 340 } | 340 } |
| 341 #endif // defined(OS_LINUX) | 341 #endif // defined(OS_LINUX) |
| 342 | 342 |
| 343 // Similar to GetComponentUpdatedPepperFlash, this should be used on Linux only | 343 #if defined(OS_CHROMEOS) || defined(OS_LINUX) |
| 344 // because on other platforms the component updater can take responsibility for | 344 // This should be used on ChromeOS and Linux only - other platforms do not |
| 345 // locating and registering the bundled version of Flash. | 345 // bundle Flash. |
| 346 // However, a large number of tests depend upon having Flash registered | |
| 347 // *synchronously* during browser startup. | |
| 348 // TODO(waffles): Fix those tests and then compile / run this only on Linux. | |
| 349 bool GetBundledPepperFlash(content::PepperPluginInfo* plugin) { | 346 bool GetBundledPepperFlash(content::PepperPluginInfo* plugin) { |
| 350 #if defined(FLAPPER_AVAILABLE) | 347 #if defined(FLAPPER_AVAILABLE) |
| 351 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 348 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 352 | 349 |
| 353 // Ignore bundled Pepper Flash if there is Pepper Flash specified from the | 350 // Ignore bundled Pepper Flash if there is Pepper Flash specified from the |
| 354 // command-line. | 351 // command-line. |
| 355 if (command_line->HasSwitch(switches::kPpapiFlashPath)) | 352 if (command_line->HasSwitch(switches::kPpapiFlashPath)) |
| 356 return false; | 353 return false; |
| 357 | 354 |
| 358 bool force_disable = | 355 bool force_disable = |
| 359 command_line->HasSwitch(switches::kDisableBundledPpapiFlash); | 356 command_line->HasSwitch(switches::kDisableBundledPpapiFlash); |
| 360 if (force_disable) | 357 if (force_disable) |
| 361 return false; | 358 return false; |
| 362 | 359 |
| 363 base::FilePath flash_path; | 360 base::FilePath flash_path; |
| 364 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &flash_path)) | 361 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &flash_path)) |
| 365 return false; | 362 return false; |
| 366 | 363 |
| 367 *plugin = CreatePepperFlashInfo(flash_path, FLAPPER_VERSION_STRING, false, | 364 *plugin = CreatePepperFlashInfo(flash_path, FLAPPER_VERSION_STRING, false, |
| 368 false, true); | 365 false, true); |
| 369 return true; | 366 return true; |
| 370 #else | 367 #else |
| 371 return false; | 368 return false; |
| 372 #endif // FLAPPER_AVAILABLE | 369 #endif // FLAPPER_AVAILABLE |
| 373 } | 370 } |
| 371 #endif // defined(OS_CHROMEOS) || defined(OS_LINUX) |
| 374 | 372 |
| 375 bool GetSystemPepperFlash(content::PepperPluginInfo* plugin) { | 373 bool GetSystemPepperFlash(content::PepperPluginInfo* plugin) { |
| 376 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 374 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
| 377 // Do not try and find System Pepper Flash if there is a specific path on | 375 // Do not try and find System Pepper Flash if there is a specific path on |
| 378 // the commmand-line. | 376 // the commmand-line. |
| 379 if (command_line->HasSwitch(switches::kPpapiFlashPath)) | 377 if (command_line->HasSwitch(switches::kPpapiFlashPath)) |
| 380 return false; | 378 return false; |
| 381 | 379 |
| 382 base::FilePath flash_filename; | 380 base::FilePath flash_filename; |
| 383 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN, | 381 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN, |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 532 | 530 |
| 533 ScopedVector<content::PepperPluginInfo> flash_versions; | 531 ScopedVector<content::PepperPluginInfo> flash_versions; |
| 534 | 532 |
| 535 #if defined(OS_LINUX) | 533 #if defined(OS_LINUX) |
| 536 std::unique_ptr<content::PepperPluginInfo> component_flash( | 534 std::unique_ptr<content::PepperPluginInfo> component_flash( |
| 537 new content::PepperPluginInfo); | 535 new content::PepperPluginInfo); |
| 538 if (GetComponentUpdatedPepperFlash(component_flash.get())) | 536 if (GetComponentUpdatedPepperFlash(component_flash.get())) |
| 539 flash_versions.push_back(component_flash.release()); | 537 flash_versions.push_back(component_flash.release()); |
| 540 #endif // defined(OS_LINUX) | 538 #endif // defined(OS_LINUX) |
| 541 | 539 |
| 540 #if defined(OS_CHROMEOS) || defined(OS_LINUX) |
| 542 std::unique_ptr<content::PepperPluginInfo> bundled_flash( | 541 std::unique_ptr<content::PepperPluginInfo> bundled_flash( |
| 543 new content::PepperPluginInfo); | 542 new content::PepperPluginInfo); |
| 544 if (GetBundledPepperFlash(bundled_flash.get())) | 543 if (GetBundledPepperFlash(bundled_flash.get())) |
| 545 flash_versions.push_back(bundled_flash.release()); | 544 flash_versions.push_back(bundled_flash.release()); |
| 545 #endif // defined(OS_CHROMEOS) || defined(OS_LINUX) |
| 546 | 546 |
| 547 std::unique_ptr<content::PepperPluginInfo> system_flash( | 547 std::unique_ptr<content::PepperPluginInfo> system_flash( |
| 548 new content::PepperPluginInfo); | 548 new content::PepperPluginInfo); |
| 549 if (GetSystemPepperFlash(system_flash.get())) | 549 if (GetSystemPepperFlash(system_flash.get())) |
| 550 flash_versions.push_back(system_flash.release()); | 550 flash_versions.push_back(system_flash.release()); |
| 551 | 551 |
| 552 // This function will return only the most recent version of the flash plugin. | 552 // This function will return only the most recent version of the flash plugin. |
| 553 content::PepperPluginInfo* max_flash = | 553 content::PepperPluginInfo* max_flash = |
| 554 FindMostRecentPlugin(flash_versions.get()); | 554 FindMostRecentPlugin(flash_versions.get()); |
| 555 if (max_flash) | 555 if (max_flash) |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 718 origin_trial_policy_ = base::WrapUnique(new ChromeOriginTrialPolicy()); | 718 origin_trial_policy_ = base::WrapUnique(new ChromeOriginTrialPolicy()); |
| 719 } | 719 } |
| 720 return origin_trial_policy_.get(); | 720 return origin_trial_policy_.get(); |
| 721 } | 721 } |
| 722 | 722 |
| 723 #if defined(OS_ANDROID) | 723 #if defined(OS_ANDROID) |
| 724 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { | 724 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { |
| 725 return new ChromeMediaClientAndroid(); | 725 return new ChromeMediaClientAndroid(); |
| 726 } | 726 } |
| 727 #endif // OS_ANDROID | 727 #endif // OS_ANDROID |
| OLD | NEW |