diff options
Diffstat (limited to 'chrome/common')
-rw-r--r-- | chrome/common/chrome_content_client.cc | 34 | ||||
-rw-r--r-- | chrome/common/chrome_paths.cc | 17 | ||||
-rw-r--r-- | chrome/common/chrome_paths.h | 2 |
3 files changed, 47 insertions, 6 deletions
diff --git a/chrome/common/chrome_content_client.cc b/chrome/common/chrome_content_client.cc index f9c8330..69f1e36 100644 --- a/chrome/common/chrome_content_client.cc +++ b/chrome/common/chrome_content_client.cc @@ -36,6 +36,7 @@ #include "webkit/user_agent/user_agent_util.h" #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR. +#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. #if defined(OS_WIN) #include "base/win/registry.h" @@ -79,8 +80,11 @@ const char kGTalkPluginDescription[] = "Google Talk Plugin"; const uint32 kGTalkPluginPermissions = ppapi::PERMISSION_PRIVATE | ppapi::PERMISSION_DEV; -const char kInterposeLibraryPath[] = - "@executable_path/../../../libplugin_carbon_interpose.dylib"; +#if defined(WIDEVINE_CDM_AVAILABLE) +const char kWidevineCdmPluginExtension[] = ""; +const uint32 kWidevineCdmPluginPermissions = ppapi::PERMISSION_PRIVATE | + ppapi::PERMISSION_DEV; +#endif // WIDEVINE_CDM_AVAILABLE #if defined(ENABLE_REMOTING) #if defined(GOOGLE_CHROME_BUILD) @@ -102,6 +106,9 @@ const char kRemotingViewerPluginMimeExtension[] = ""; const char kRemotingViewerPluginMimeDescription[] = ""; #endif // defined(ENABLE_REMOTING) +const char kInterposeLibraryPath[] = + "@executable_path/../../../libplugin_carbon_interpose.dylib"; + // Appends the known built-in plugins to the given vector. Some built-in // plugins are "internal" which means they are compiled into the Chrome binary, // and some are extra shared libraries distributed with the browser (these are @@ -196,6 +203,29 @@ void ComputeBuiltInPlugins(std::vector<content::PepperPluginInfo>* plugins) { } } +#if defined(WIDEVINE_CDM_AVAILABLE) + static bool skip_widevine_cdm_file_check = false; + if (PathService::Get(chrome::FILE_WIDEVINE_CDM_PLUGIN, &path)) { + if (skip_widevine_cdm_file_check || file_util::PathExists(path)) { + content::PepperPluginInfo widevine_cdm; + widevine_cdm.is_out_of_process = true; + widevine_cdm.path = path; + widevine_cdm.name = kWidevineCdmPluginName; + widevine_cdm.description = kWidevineCdmPluginDescription; + widevine_cdm.version = WIDEVINE_CDM_VERSION_STRING; + webkit::WebPluginMimeType widevine_cdm_mime_type( + kWidevineCdmPluginMimeType, + kWidevineCdmPluginExtension, + kWidevineCdmPluginMimeTypeDescription); + widevine_cdm.mime_types.push_back(widevine_cdm_mime_type); + widevine_cdm.permissions = kWidevineCdmPluginPermissions; + plugins->push_back(widevine_cdm); + + skip_widevine_cdm_file_check = true; + } + } +#endif // WIDEVINE_CDM_AVAILABLE + // The Remoting Viewer plugin is built-in. #if defined(ENABLE_REMOTING) content::PepperPluginInfo info; diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc index 9a666a3..ab3cff3 100644 --- a/chrome/common/chrome_paths.cc +++ b/chrome/common/chrome_paths.cc @@ -23,6 +23,8 @@ #include "base/mac/mac_util.h" #endif +#include "widevine_cdm_version.h" // In SHARED_INTERMEDIATE_DIR. + namespace { // File name of the internal Flash plugin on different platforms. @@ -322,16 +324,23 @@ bool PathProvider(int key, FilePath* result) { cur = cur.Append(kInternalNaClHelperBootstrapFileName); break; case chrome::FILE_O3D_PLUGIN: - if (!PathService::Get(base::DIR_MODULE, &cur)) - return false; + if (!PathService::Get(base::DIR_MODULE, &cur)) + return false; cur = cur.Append(kO3DPluginFileName); break; case chrome::FILE_GTALK_PLUGIN: - if (!PathService::Get(base::DIR_MODULE, &cur)) - return false; + if (!PathService::Get(base::DIR_MODULE, &cur)) + return false; cur = cur.Append(kGTalkPluginFileName); break; #endif +#if defined(WIDEVINE_CDM_AVAILABLE) + case chrome::FILE_WIDEVINE_CDM_PLUGIN: + if (!PathService::Get(base::DIR_MODULE, &cur)) + return false; + cur = cur.Append(kWidevineCdmPluginFileName); + break; +#endif case chrome::FILE_RESOURCES_PACK: #if defined(OS_MACOSX) if (base::mac::AmIBundled()) { diff --git a/chrome/common/chrome_paths.h b/chrome/common/chrome_paths.h index 64813a7..8763836 100644 --- a/chrome/common/chrome_paths.h +++ b/chrome/common/chrome_paths.h @@ -103,6 +103,8 @@ enum { // (subdir of DIR_PNACL_BASE). FILE_O3D_PLUGIN, // Full path to the O3D Pepper plugin file. FILE_GTALK_PLUGIN, // Full path to the GTalk Pepper plugin file. + FILE_WIDEVINE_CDM_PLUGIN, // Full path to the Widevine CDM Pepper plugin + // file. FILE_LIBAVCODEC, // Full path to libavcodec media decoding // library. FILE_LIBAVFORMAT, // Full path to libavformat media parsing |