fix: Save As PDF from PDF Preview (#25959)
This commit is contained in:
parent
708cf44d19
commit
eca53aaaf1
4 changed files with 47 additions and 4 deletions
|
@ -14,6 +14,12 @@
|
|||
#include "shell/browser/extensions/electron_extension_web_contents_observer.h"
|
||||
#include "shell/browser/extensions/electron_messaging_delegate.h"
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
#include "chrome/browser/printing/print_view_manager_basic.h"
|
||||
#include "components/printing/browser/print_manager_utils.h"
|
||||
#include "shell/browser/printing/print_preview_message_handler.h"
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||
#include "components/pdf/browser/pdf_web_contents_helper.h" // nogncheck
|
||||
#include "shell/browser/electron_pdf_web_contents_helper_client.h"
|
||||
|
@ -52,13 +58,18 @@ MessagingDelegate* ElectronExtensionsAPIClient::GetMessagingDelegate() {
|
|||
|
||||
void ElectronExtensionsAPIClient::AttachWebContentsHelpers(
|
||||
content::WebContents* web_contents) const {
|
||||
extensions::ElectronExtensionWebContentsObserver::CreateForWebContents(
|
||||
web_contents);
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
electron::PrintPreviewMessageHandler::CreateForWebContents(web_contents);
|
||||
printing::PrintViewManagerBasic::CreateForWebContents(web_contents);
|
||||
#endif
|
||||
|
||||
#if BUILDFLAG(ENABLE_PDF_VIEWER)
|
||||
pdf::PDFWebContentsHelper::CreateForWebContentsWithClient(
|
||||
web_contents, std::make_unique<ElectronPDFWebContentsHelperClient>());
|
||||
#endif
|
||||
|
||||
extensions::ElectronExtensionWebContentsObserver::CreateForWebContents(
|
||||
web_contents);
|
||||
}
|
||||
|
||||
ManagementAPIDelegate*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue