chore: cleanup ElectronContentClient::AddPlugins
(#37005)
chore: cleanup ElectronContentClient::AddPlugins
This commit is contained in:
parent
ca3145a547
commit
86f99e9cf0
1 changed files with 16 additions and 23 deletions
|
@ -104,26 +104,6 @@ bool IsWidevineAvailable(
|
||||||
}
|
}
|
||||||
#endif // BUILDFLAG(ENABLE_WIDEVINE)
|
#endif // BUILDFLAG(ENABLE_WIDEVINE)
|
||||||
|
|
||||||
#if BUILDFLAG(ENABLE_PLUGINS)
|
|
||||||
void ComputeBuiltInPlugins(std::vector<content::ContentPluginInfo>* plugins) {
|
|
||||||
#if BUILDFLAG(ENABLE_PDF_VIEWER)
|
|
||||||
// TODO(upstream/thestig): Figure out how to make the PDF Viewer work without
|
|
||||||
// this PPAPI plugin registration.
|
|
||||||
content::ContentPluginInfo pdf_info;
|
|
||||||
pdf_info.is_internal = true;
|
|
||||||
pdf_info.is_out_of_process = true;
|
|
||||||
pdf_info.name = kPDFInternalPluginName;
|
|
||||||
pdf_info.description = "Portable Document Format";
|
|
||||||
// This isn't a real file path; it's just used as a unique identifier.
|
|
||||||
pdf_info.path = base::FilePath(kPdfPluginPath);
|
|
||||||
content::WebPluginMimeType pdf_mime_type(pdf::kInternalPluginMimeType, "pdf",
|
|
||||||
"Portable Document Format");
|
|
||||||
pdf_info.mime_types.push_back(pdf_mime_type);
|
|
||||||
plugins->push_back(pdf_info);
|
|
||||||
#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
|
|
||||||
}
|
|
||||||
#endif // BUILDFLAG(ENABLE_PLUGINS)
|
|
||||||
|
|
||||||
void AppendDelimitedSwitchToVector(const base::StringPiece cmd_switch,
|
void AppendDelimitedSwitchToVector(const base::StringPiece cmd_switch,
|
||||||
std::vector<std::string>* append_me) {
|
std::vector<std::string>* append_me) {
|
||||||
auto* command_line = base::CommandLine::ForCurrentProcess();
|
auto* command_line = base::CommandLine::ForCurrentProcess();
|
||||||
|
@ -204,9 +184,22 @@ void ElectronContentClient::AddAdditionalSchemes(Schemes* schemes) {
|
||||||
|
|
||||||
void ElectronContentClient::AddPlugins(
|
void ElectronContentClient::AddPlugins(
|
||||||
std::vector<content::ContentPluginInfo>* plugins) {
|
std::vector<content::ContentPluginInfo>* plugins) {
|
||||||
#if BUILDFLAG(ENABLE_PLUGINS)
|
#if BUILDFLAG(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||||
ComputeBuiltInPlugins(plugins);
|
static constexpr char kPDFPluginExtension[] = "pdf";
|
||||||
#endif // BUILDFLAG(ENABLE_PLUGINS)
|
static constexpr char kPDFPluginDescription[] = "Portable Document Format";
|
||||||
|
|
||||||
|
content::ContentPluginInfo pdf_info;
|
||||||
|
pdf_info.is_internal = true;
|
||||||
|
pdf_info.is_out_of_process = true;
|
||||||
|
pdf_info.name = kPDFInternalPluginName;
|
||||||
|
pdf_info.description = kPDFPluginDescription;
|
||||||
|
// This isn't a real file path; it's just used as a unique identifier.
|
||||||
|
pdf_info.path = base::FilePath(kPdfPluginPath);
|
||||||
|
content::WebPluginMimeType pdf_mime_type(
|
||||||
|
pdf::kInternalPluginMimeType, kPDFPluginExtension, kPDFPluginDescription);
|
||||||
|
pdf_info.mime_types.push_back(pdf_mime_type);
|
||||||
|
plugins->push_back(pdf_info);
|
||||||
|
#endif // BUILDFLAG(ENABLE_PLUGINS) && BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||||
}
|
}
|
||||||
|
|
||||||
void ElectronContentClient::AddContentDecryptionModules(
|
void ElectronContentClient::AddContentDecryptionModules(
|
||||||
|
|
Loading…
Reference in a new issue