Move GetPrintHandler to CefClient (see issue #2196)

This new location is preferred because we now know the associated CefBrowser
for all CefPrintHandler callbacks.
This commit is contained in:
Marshall Greenblatt
2021-03-30 09:16:51 -07:00
parent f7a4c777e8
commit 7876a2f321
25 changed files with 112 additions and 129 deletions

View File

@ -9,7 +9,7 @@
// implementations. See the translator.README.txt file in the tools directory
// for more information.
//
// $hash=d07c33f1e14a7d42feac46fa1bf27dbfab50c97f$
// $hash=15d1e044a5bc40ca25c72f070a9b996907c4c0cb$
//
#include "libcef_dll/cpptoc/print_handler_cpptoc.h"
@ -161,6 +161,7 @@ print_handler_on_print_reset(struct _cef_print_handler_t* self,
cef_size_t CEF_CALLBACK
print_handler_get_pdf_paper_size(struct _cef_print_handler_t* self,
cef_browser_t* browser,
int device_units_per_inch) {
shutdown_checker::AssertNotShutdown();
@ -169,10 +170,14 @@ print_handler_get_pdf_paper_size(struct _cef_print_handler_t* self,
DCHECK(self);
if (!self)
return CefSize();
// Verify param: browser; type: refptr_diff
DCHECK(browser);
if (!browser)
return CefSize();
// Execute
cef_size_t _retval =
CefPrintHandlerCppToC::Get(self)->GetPdfPaperSize(device_units_per_inch);
cef_size_t _retval = CefPrintHandlerCppToC::Get(self)->GetPdfPaperSize(
CefBrowserCToCpp::Wrap(browser), device_units_per_inch);
// Return type: simple
return _retval;