fix: compilation error when disabling extensions and pdf_viewer (#47964)

This commit is contained in:
wujinli 2025-08-07 23:18:32 +08:00 committed by GitHub
commit f49a645c06
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -81,6 +81,7 @@ bool IsDeviceNameValid(const std::u16string& device_name) {
namespace {
#if BUILDFLAG(ENABLE_PDF_VIEWER)
// Duplicated from chrome/browser/printing/print_view_manager_common.cc
content::RenderFrameHost* GetFullPagePlugin(content::WebContents* contents) {
content::RenderFrameHost* full_page_plugin = nullptr;
@ -99,6 +100,7 @@ content::RenderFrameHost* GetFullPagePlugin(content::WebContents* contents) {
#endif // BUILDFLAG(ENABLE_ELECTRON_EXTENSIONS)
return full_page_plugin;
}
#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
} // namespace
@ -119,7 +121,7 @@ content::RenderFrameHost* GetRenderFrameHostToUse(
if (pdf_rfh) {
return pdf_rfh;
}
#endif // BUILDFLAG(ENABLE_PDF)
#endif // BUILDFLAG(ENABLE_PDF_VIEWER)
auto* focused_frame = contents->GetFocusedFrame();
return (focused_frame && focused_frame->HasSelection())
? focused_frame