fix: pdf download not working (#24946)
This commit is contained in:
parent
db13dcb8d2
commit
befbbc27d8
1 changed files with 11 additions and 0 deletions
|
@ -8,9 +8,15 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h"
|
#include "extensions/browser/guest_view/mime_handler_view/mime_handler_view_guest_delegate.h"
|
||||||
|
#include "printing/buildflags/buildflags.h"
|
||||||
#include "shell/browser/extensions/electron_extension_web_contents_observer.h"
|
#include "shell/browser/extensions/electron_extension_web_contents_observer.h"
|
||||||
#include "shell/browser/extensions/electron_messaging_delegate.h"
|
#include "shell/browser/extensions/electron_messaging_delegate.h"
|
||||||
|
|
||||||
|
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||||
|
#include "components/pdf/browser/pdf_web_contents_helper.h"
|
||||||
|
#include "shell/browser/electron_pdf_web_contents_helper_client.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace extensions {
|
namespace extensions {
|
||||||
|
|
||||||
class ElectronMimeHandlerViewGuestDelegate
|
class ElectronMimeHandlerViewGuestDelegate
|
||||||
|
@ -46,6 +52,11 @@ void ElectronExtensionsAPIClient::AttachWebContentsHelpers(
|
||||||
content::WebContents* web_contents) const {
|
content::WebContents* web_contents) const {
|
||||||
extensions::ElectronExtensionWebContentsObserver::CreateForWebContents(
|
extensions::ElectronExtensionWebContentsObserver::CreateForWebContents(
|
||||||
web_contents);
|
web_contents);
|
||||||
|
|
||||||
|
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||||
|
pdf::PDFWebContentsHelper::CreateForWebContentsWithClient(
|
||||||
|
web_contents, std::make_unique<ElectronPDFWebContentsHelperClient>());
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
std::unique_ptr<MimeHandlerViewGuestDelegate>
|
std::unique_ptr<MimeHandlerViewGuestDelegate>
|
||||||
|
|
Loading…
Reference in a new issue