cef/patch/patches/chrome_browser_printing_oop_osr.patch
Nik Pavlov af1f40a2d3 Update to Chromium version 129.0.6668.0
- Mac: Minimum system version is now 11.0.
- Win: Windows SDK version is now 10.0.22621.2428.
2024-08-26 12:44:25 +00:00

22 lines
1017 B
Diff

diff --git chrome/browser/printing/print_backend_service_manager.cc chrome/browser/printing/print_backend_service_manager.cc
index 8fe9a3e263964..548609bc78b33 100644
--- chrome/browser/printing/print_backend_service_manager.cc
+++ chrome/browser/printing/print_backend_service_manager.cc
@@ -75,7 +75,15 @@ PrintBackendServiceManager* g_print_backend_service_manager_singleton = nullptr;
// to support modal dialogs from OOP.
uint32_t NativeViewToUint(gfx::NativeView view) {
#if BUILDFLAG(IS_WIN)
- return base::win::HandleToUint32(views::HWNDForNativeView(view));
+ // |view| will be nullptr with CEF OSR. In that case return the desktop
+ // window handle (same behavior as PrintingContextWin::GetRootWindow) to
+ // avoid a DCHECK in PrintingContextSystemDialogWin::AskUserForSettings
+ // with OOP printing.
+ HWND hwnd = views::HWNDForNativeView(view);
+ if (!hwnd) {
+ hwnd = ::GetDesktopWindow();
+ }
+ return base::win::HandleToUint32(hwnd);
#else
NOTREACHED_IN_MIGRATION();
return 0;