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