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 320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 } | 331 } |
332 *plugin = CreatePepperFlashInfo(flash_path, version, false, false, false); | 332 *plugin = CreatePepperFlashInfo(flash_path, version, false, false, false); |
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 | 342 |
342 // Similar to GetComponentUpdatedPepperFlash, this is used on Linux only because | |
343 // on other platforms the component updater will take responsibility for | |
344 // locating and registering the bundled version of Flash. | |
345 bool GetBundledPepperFlash(content::PepperPluginInfo* plugin) { | 343 bool GetBundledPepperFlash(content::PepperPluginInfo* plugin) { |
346 #if defined(FLAPPER_AVAILABLE) | 344 #if defined(FLAPPER_AVAILABLE) |
347 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 345 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
348 | 346 |
349 // Ignore bundled Pepper Flash if there is Pepper Flash specified from the | 347 // Ignore bundled Pepper Flash if there is Pepper Flash specified from the |
350 // command-line. | 348 // command-line. |
351 if (command_line->HasSwitch(switches::kPpapiFlashPath)) | 349 if (command_line->HasSwitch(switches::kPpapiFlashPath)) |
352 return false; | 350 return false; |
353 | 351 |
354 bool force_disable = | 352 bool force_disable = |
355 command_line->HasSwitch(switches::kDisableBundledPpapiFlash); | 353 command_line->HasSwitch(switches::kDisableBundledPpapiFlash); |
356 if (force_disable) | 354 if (force_disable) |
357 return false; | 355 return false; |
358 | 356 |
359 base::FilePath flash_path; | 357 base::FilePath flash_path; |
360 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &flash_path)) | 358 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_PLUGIN, &flash_path)) |
361 return false; | 359 return false; |
362 | 360 |
363 *plugin = CreatePepperFlashInfo(flash_path, FLAPPER_VERSION_STRING, false, | 361 *plugin = CreatePepperFlashInfo(flash_path, FLAPPER_VERSION_STRING, false, |
364 false, true); | 362 false, true); |
365 return true; | 363 return true; |
366 #else | 364 #else |
367 return false; | 365 return false; |
368 #endif // FLAPPER_AVAILABLE | 366 #endif // FLAPPER_AVAILABLE |
369 } | 367 } |
370 #endif // defined(OS_LINUX) | |
371 | 368 |
372 bool GetSystemPepperFlash(content::PepperPluginInfo* plugin) { | 369 bool GetSystemPepperFlash(content::PepperPluginInfo* plugin) { |
373 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); | 370 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess(); |
374 // Do not try and find System Pepper Flash if there is a specific path on | 371 // Do not try and find System Pepper Flash if there is a specific path on |
375 // the commmand-line. | 372 // the commmand-line. |
376 if (command_line->HasSwitch(switches::kPpapiFlashPath)) | 373 if (command_line->HasSwitch(switches::kPpapiFlashPath)) |
377 return false; | 374 return false; |
378 | 375 |
379 base::FilePath flash_filename; | 376 base::FilePath flash_filename; |
380 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN, | 377 if (!PathService::Get(chrome::FILE_PEPPER_FLASH_SYSTEM_PLUGIN, |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 } | 524 } |
528 #endif // defined(OS_LINUX) | 525 #endif // defined(OS_LINUX) |
529 | 526 |
530 ScopedVector<content::PepperPluginInfo> flash_versions; | 527 ScopedVector<content::PepperPluginInfo> flash_versions; |
531 | 528 |
532 #if defined(OS_LINUX) | 529 #if defined(OS_LINUX) |
533 std::unique_ptr<content::PepperPluginInfo> component_flash( | 530 std::unique_ptr<content::PepperPluginInfo> component_flash( |
534 new content::PepperPluginInfo); | 531 new content::PepperPluginInfo); |
535 if (GetComponentUpdatedPepperFlash(component_flash.get())) | 532 if (GetComponentUpdatedPepperFlash(component_flash.get())) |
536 flash_versions.push_back(component_flash.release()); | 533 flash_versions.push_back(component_flash.release()); |
| 534 #endif // defined(OS_LINUX) |
537 | 535 |
538 std::unique_ptr<content::PepperPluginInfo> bundled_flash( | 536 std::unique_ptr<content::PepperPluginInfo> bundled_flash( |
539 new content::PepperPluginInfo); | 537 new content::PepperPluginInfo); |
540 if (GetBundledPepperFlash(bundled_flash.get())) | 538 if (GetBundledPepperFlash(bundled_flash.get())) |
541 flash_versions.push_back(bundled_flash.release()); | 539 flash_versions.push_back(bundled_flash.release()); |
542 #endif // defined(OS_LINUX) | |
543 | 540 |
544 std::unique_ptr<content::PepperPluginInfo> system_flash( | 541 std::unique_ptr<content::PepperPluginInfo> system_flash( |
545 new content::PepperPluginInfo); | 542 new content::PepperPluginInfo); |
546 if (GetSystemPepperFlash(system_flash.get())) | 543 if (GetSystemPepperFlash(system_flash.get())) |
547 flash_versions.push_back(system_flash.release()); | 544 flash_versions.push_back(system_flash.release()); |
548 | 545 |
549 // This function will return only the most recent version of the flash plugin. | 546 // This function will return only the most recent version of the flash plugin. |
550 content::PepperPluginInfo* max_flash = | 547 content::PepperPluginInfo* max_flash = |
551 FindMostRecentPlugin(flash_versions.get()); | 548 FindMostRecentPlugin(flash_versions.get()); |
552 if (max_flash) | 549 if (max_flash) |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
715 origin_trial_policy_ = base::WrapUnique(new ChromeOriginTrialPolicy()); | 712 origin_trial_policy_ = base::WrapUnique(new ChromeOriginTrialPolicy()); |
716 } | 713 } |
717 return origin_trial_policy_.get(); | 714 return origin_trial_policy_.get(); |
718 } | 715 } |
719 | 716 |
720 #if defined(OS_ANDROID) | 717 #if defined(OS_ANDROID) |
721 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { | 718 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { |
722 return new ChromeMediaClientAndroid(); | 719 return new ChromeMediaClientAndroid(); |
723 } | 720 } |
724 #endif // OS_ANDROID | 721 #endif // OS_ANDROID |
OLD | NEW |