| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 #include "flapper_version.h" // nogncheck In SHARED_INTERMEDIATE_DIR. | 78 #include "flapper_version.h" // nogncheck In SHARED_INTERMEDIATE_DIR. |
| 79 #include "ppapi/shared_impl/ppapi_permissions.h" | 79 #include "ppapi/shared_impl/ppapi_permissions.h" |
| 80 #endif | 80 #endif |
| 81 | 81 |
| 82 #if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS) && \ | 82 #if defined(WIDEVINE_CDM_AVAILABLE) && BUILDFLAG(ENABLE_PEPPER_CDMS) && \ |
| 83 !defined(WIDEVINE_CDM_IS_COMPONENT) | 83 !defined(WIDEVINE_CDM_IS_COMPONENT) |
| 84 #define WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT | 84 #define WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT |
| 85 #include "chrome/common/widevine_cdm_constants.h" | 85 #include "chrome/common/widevine_cdm_constants.h" |
| 86 #endif | 86 #endif |
| 87 | 87 |
| 88 #if BUILDFLAG(ENABLE_PEPPER_CDMS) |
| 89 #include "chrome/common/media/cdm_host_file_path.h" |
| 90 #endif |
| 91 |
| 88 #if defined(OS_ANDROID) | 92 #if defined(OS_ANDROID) |
| 89 #include "chrome/common/chrome_media_client_android.h" | 93 #include "chrome/common/chrome_media_client_android.h" |
| 90 #endif | 94 #endif |
| 91 | 95 |
| 92 namespace { | 96 namespace { |
| 93 | 97 |
| 94 #if BUILDFLAG(ENABLE_PLUGINS) | 98 #if BUILDFLAG(ENABLE_PLUGINS) |
| 95 #if BUILDFLAG(ENABLE_PDF) | 99 #if BUILDFLAG(ENABLE_PDF) |
| 96 const char kPDFPluginExtension[] = "pdf"; | 100 const char kPDFPluginExtension[] = "pdf"; |
| 97 const char kPDFPluginDescription[] = "Portable Document Format"; | 101 const char kPDFPluginDescription[] = "Portable Document Format"; |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 // better than any other hardcoded alternative. | 531 // better than any other hardcoded alternative. |
| 528 plugins->push_back(CreatePepperFlashInfo( | 532 plugins->push_back(CreatePepperFlashInfo( |
| 529 base::FilePath::FromUTF8Unsafe(ChromeContentClient::kNotPresent), | 533 base::FilePath::FromUTF8Unsafe(ChromeContentClient::kNotPresent), |
| 530 FLAPPER_VERSION_STRING, false)); | 534 FLAPPER_VERSION_STRING, false)); |
| 531 #endif // defined(GOOGLE_CHROME_BUILD) && defined(FLAPPER_AVAILABLE) | 535 #endif // defined(GOOGLE_CHROME_BUILD) && defined(FLAPPER_AVAILABLE) |
| 532 } | 536 } |
| 533 #endif // BUILDFLAG(ENABLE_PLUGINS) | 537 #endif // BUILDFLAG(ENABLE_PLUGINS) |
| 534 } | 538 } |
| 535 | 539 |
| 536 void ChromeContentClient::AddContentDecryptionModules( | 540 void ChromeContentClient::AddContentDecryptionModules( |
| 537 std::vector<content::CdmInfo>* cdms) { | 541 std::vector<content::CdmInfo>* cdms, |
| 542 std::vector<content::CdmHostFilePath>* cdm_host_file_paths) { |
| 543 if (cdms) { |
| 538 // TODO(jrummell): Need to have a better flag to indicate systems Widevine | 544 // TODO(jrummell): Need to have a better flag to indicate systems Widevine |
| 539 // is available on. For now we continue to use ENABLE_PEPPER_CDMS so that | 545 // is available on. For now we continue to use ENABLE_PEPPER_CDMS so that |
| 540 // we can experiment between pepper and mojo. | 546 // we can experiment between pepper and mojo. |
| 541 #if defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT) | 547 #if defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT) |
| 542 base::FilePath adapter_path; | 548 base::FilePath adapter_path; |
| 543 base::FilePath cdm_path; | 549 base::FilePath cdm_path; |
| 544 std::vector<std::string> codecs_supported; | 550 std::vector<std::string> codecs_supported; |
| 545 if (IsWidevineAvailable(&adapter_path, &cdm_path, &codecs_supported)) { | 551 if (IsWidevineAvailable(&adapter_path, &cdm_path, &codecs_supported)) { |
| 546 // CdmInfo needs |path| to be the actual Widevine library, | 552 // CdmInfo needs |path| to be the actual Widevine library, |
| 547 // not the adapter, so adjust as necessary. It will be in the | 553 // not the adapter, so adjust as necessary. It will be in the |
| 548 // same directory as the installed adapter. | 554 // same directory as the installed adapter. |
| 549 const base::Version version(WIDEVINE_CDM_VERSION_STRING); | 555 const base::Version version(WIDEVINE_CDM_VERSION_STRING); |
| 550 DCHECK(version.IsValid()); | 556 DCHECK(version.IsValid()); |
| 551 cdms->push_back(content::CdmInfo(kWidevineCdmType, version, cdm_path, | 557 cdms->push_back(content::CdmInfo(kWidevineCdmType, version, cdm_path, |
| 552 codecs_supported)); | 558 codecs_supported)); |
| 553 } | 559 } |
| 554 #endif // defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT) | 560 #endif // defined(WIDEVINE_CDM_AVAILABLE_NOT_COMPONENT) |
| 555 | 561 |
| 556 // TODO(jrummell): Add External Clear Key CDM for testing, if it's available. | 562 // TODO(jrummell): Add External Clear Key CDM for testing, if it's |
| 563 // available. |
| 564 } |
| 565 |
| 566 #if BUILDFLAG(ENABLE_PEPPER_CDMS) |
| 567 if (cdm_host_file_paths) |
| 568 chrome::AddCdmHostFilePaths(cdm_host_file_paths); |
| 569 #endif |
| 557 } | 570 } |
| 558 | 571 |
| 559 static const char* const kChromeStandardURLSchemes[] = { | 572 static const char* const kChromeStandardURLSchemes[] = { |
| 560 extensions::kExtensionScheme, | 573 extensions::kExtensionScheme, |
| 561 chrome::kChromeNativeScheme, | 574 chrome::kChromeNativeScheme, |
| 562 chrome::kChromeSearchScheme, | 575 chrome::kChromeSearchScheme, |
| 563 dom_distiller::kDomDistillerScheme, | 576 dom_distiller::kDomDistillerScheme, |
| 564 #if defined(OS_CHROMEOS) | 577 #if defined(OS_CHROMEOS) |
| 565 chrome::kCrosScheme, | 578 chrome::kCrosScheme, |
| 566 #endif | 579 #endif |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 688 if (!origin_trial_policy_) | 701 if (!origin_trial_policy_) |
| 689 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>(); | 702 origin_trial_policy_ = base::MakeUnique<ChromeOriginTrialPolicy>(); |
| 690 return origin_trial_policy_.get(); | 703 return origin_trial_policy_.get(); |
| 691 } | 704 } |
| 692 | 705 |
| 693 #if defined(OS_ANDROID) | 706 #if defined(OS_ANDROID) |
| 694 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { | 707 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { |
| 695 return new ChromeMediaClientAndroid(); | 708 return new ChromeMediaClientAndroid(); |
| 696 } | 709 } |
| 697 #endif // OS_ANDROID | 710 #endif // OS_ANDROID |
| OLD | NEW |