fix: guard pdf behind correct buildflags (#23404)
This commit is contained in:
parent
f176d2494f
commit
bac9ac1163
1 changed files with 6 additions and 4 deletions
|
@ -53,6 +53,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BUILDFLAG(ENABLE_PDF_VIEWER)
|
#if BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||||
|
#include "chrome/renderer/pepper/chrome_pdf_print_client.h"
|
||||||
#include "shell/common/electron_constants.h"
|
#include "shell/common/electron_constants.h"
|
||||||
#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
|
#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||||
|
|
||||||
|
@ -68,7 +69,6 @@
|
||||||
|
|
||||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
|
||||||
#include "base/strings/utf_string_conversions.h"
|
#include "base/strings/utf_string_conversions.h"
|
||||||
#include "chrome/renderer/pepper/chrome_pdf_print_client.h"
|
|
||||||
#include "content/public/common/webplugininfo.h"
|
#include "content/public/common/webplugininfo.h"
|
||||||
#include "extensions/common/constants.h"
|
#include "extensions/common/constants.h"
|
||||||
#include "extensions/common/extensions_client.h"
|
#include "extensions/common/extensions_client.h"
|
||||||
|
@ -162,10 +162,12 @@ void RendererClientBase::RenderThreadStarted() {
|
||||||
extensions_renderer_client_.reset(new ElectronExtensionsRendererClient);
|
extensions_renderer_client_.reset(new ElectronExtensionsRendererClient);
|
||||||
extensions::ExtensionsRendererClient::Set(extensions_renderer_client_.get());
|
extensions::ExtensionsRendererClient::Set(extensions_renderer_client_.get());
|
||||||
|
|
||||||
|
thread->AddObserver(extensions_renderer_client_->GetDispatcher());
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||||
// Enables printing from Chrome PDF viewer.
|
// Enables printing from Chrome PDF viewer.
|
||||||
pdf::PepperPDFHost::SetPrintClient(new ChromePDFPrintClient());
|
pdf::PepperPDFHost::SetPrintClient(new ChromePDFPrintClient());
|
||||||
|
|
||||||
thread->AddObserver(extensions_renderer_client_->GetDispatcher());
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
|
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
|
||||||
|
@ -374,7 +376,7 @@ bool RendererClientBase::IsPluginHandledExternally(
|
||||||
const blink::WebElement& plugin_element,
|
const blink::WebElement& plugin_element,
|
||||||
const GURL& original_url,
|
const GURL& original_url,
|
||||||
const std::string& mime_type) {
|
const std::string& mime_type) {
|
||||||
#if BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS) && BUILDFLAG(ENABLE_PLUGINS)
|
#if BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||||
DCHECK(plugin_element.HasHTMLTagName("object") ||
|
DCHECK(plugin_element.HasHTMLTagName("object") ||
|
||||||
plugin_element.HasHTMLTagName("embed"));
|
plugin_element.HasHTMLTagName("embed"));
|
||||||
// TODO(nornagon): this info should be shared with the data in
|
// TODO(nornagon): this info should be shared with the data in
|
||||||
|
|
Loading…
Add table
Reference in a new issue