Linux: Don't pass NULL CefBrowser to PrintHandler::GetPdfPaperSize (issue #2199)

This commit is contained in:
Marshall Greenblatt
2017-06-17 12:46:18 +03:00
parent 1ebbf3c4da
commit f95fa26aa9
8 changed files with 27 additions and 34 deletions

View File

@@ -113,12 +113,9 @@ gfx::Size CefPrintDialogLinux::GetPdfPaperSize(
if (browser_handler.get()) {
CefRefPtr<CefPrintHandler> handler = browser_handler->GetPrintHandler();
if (handler.get()) {
CefRefPtr<CefBrowserHostImpl> browser =
extensions::GetOwnerBrowserForFrame(
context->render_process_id(), context->render_frame_id(), NULL);
const printing::PrintSettings& settings = context->settings();
CefSize cef_size = handler->GetPdfPaperSize(
browser.get(), settings.device_units_per_inch());
CefSize cef_size =
handler->GetPdfPaperSize(settings.device_units_per_inch());
size.SetSize(cef_size.width, cef_size.height);
}
}