fix: blank page when printing pdf (#43326)

Co-authored-by: trop[bot] <37223003+trop[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
This commit is contained in:
trop[bot] 2024-08-15 10:30:46 -04:00 committed by GitHub
parent fa4dc3c760
commit 0c72474bd4
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