fix: blank page when printing pdf (#43309)

This commit is contained in:
Shelley Vohr 2024-08-14 21:47:47 +02:00 committed by GitHub
parent f6bae51025
commit 286384258b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 92 additions and 17 deletions

View file

@ -14,6 +14,11 @@ namespace gfx {
class Size;
}
namespace content {
class RenderFrameHost;
class WebContents;
} // namespace content
namespace electron {
// This function returns the per-platform default printer's DPI.
@ -24,6 +29,9 @@ gfx::Size GetDefaultPrinterDPI(const std::u16string& device_name);
// sanity checking of device_name validity and so will crash on invalid names.
bool IsDeviceNameValid(const std::u16string& device_name);
content::RenderFrameHost* GetRenderFrameHostToUse(
content::WebContents* contents);
// This function returns a validated device name.
// If the user passed one to webContents.print(), we check that it's valid and
// return it or fail if the network doesn't recognize it. If the user didn't