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

@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=f0cd169568e9ea5bcc8bf2aa891691b76c05356d$
// $hash=54c5210924095c7e43173a2843bd28729645922b$
//
#ifndef CEF_INCLUDE_CAPI_CEF_BROWSER_PROCESS_HANDLER_CAPI_H_
@ -43,7 +43,6 @@
#include "include/capi/cef_base_capi.h"
#include "include/capi/cef_client_capi.h"
#include "include/capi/cef_command_line_capi.h"
#include "include/capi/cef_print_handler_capi.h"
#include "include/capi/cef_values_capi.h"
#ifdef __cplusplus
@ -98,13 +97,6 @@ typedef struct _cef_browser_process_handler_t {
struct _cef_browser_process_handler_t* self,
struct _cef_command_line_t* command_line);
///
// Return the handler for printing on Linux. If a print handler is not
// provided then printing will not be supported on the Linux platform.
///
struct _cef_print_handler_t*(CEF_CALLBACK* get_print_handler)(
struct _cef_browser_process_handler_t* self);
///
// Called from any thread when work has been scheduled for the browser process
// main (UI) thread. This callback is used in combination with CefSettings.

View File

@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=4cfcac55d2a1dee466a2a0753f30fb34a78ef3b2$
// $hash=14eca959988209ba8f95037a47192fd50d64f2f1$
//
#ifndef CEF_INCLUDE_CAPI_CEF_CLIENT_CAPI_H_
@ -53,6 +53,7 @@
#include "include/capi/cef_keyboard_handler_capi.h"
#include "include/capi/cef_life_span_handler_capi.h"
#include "include/capi/cef_load_handler_capi.h"
#include "include/capi/cef_print_handler_capi.h"
#include "include/capi/cef_process_message_capi.h"
#include "include/capi/cef_render_handler_capi.h"
#include "include/capi/cef_request_handler_capi.h"
@ -146,6 +147,13 @@ typedef struct _cef_client_t {
struct _cef_load_handler_t*(CEF_CALLBACK* get_load_handler)(
struct _cef_client_t* self);
///
// Return the handler for printing on Linux. If a print handler is not
// provided then printing will not be supported on the Linux platform.
///
struct _cef_print_handler_t*(CEF_CALLBACK* get_print_handler)(
struct _cef_client_t* self);
///
// Return the handler for off-screen rendering events.
///

View File

@ -33,7 +33,7 @@
// by hand. See the translator.README.txt file in the tools directory for
// more information.
//
// $hash=54ed1e16c5c1d133bcd097350c5f5871228efd4f$
// $hash=84fc58b3898f25476d9cdd260553390ba5e0b30b$
//
#ifndef CEF_INCLUDE_CAPI_CEF_PRINT_HANDLER_CAPI_H_
@ -148,6 +148,7 @@ typedef struct _cef_print_handler_t {
///
cef_size_t(CEF_CALLBACK* get_pdf_paper_size)(
struct _cef_print_handler_t* self,
struct _cef_browser_t* browser,
int device_units_per_inch);
} cef_print_handler_t;

View File

@ -42,13 +42,13 @@
// way that may cause binary incompatibility with other builds. The universal
// hash value will change if any platform is affected whereas the platform hash
// values will change only if that particular platform is affected.
#define CEF_API_HASH_UNIVERSAL "730ab5758854ad187e677f5fbdce57df8e8f4f5e"
#define CEF_API_HASH_UNIVERSAL "4291ac099ef9b3f618e9343acf4deb7e36bb5508"
#if defined(OS_WIN)
#define CEF_API_HASH_PLATFORM "747d77b684a4b579cd2c0420a7323d236f632741"
#define CEF_API_HASH_PLATFORM "0637d7a76f9339dc446c364b3fc7c1a317b0460a"
#elif defined(OS_MAC)
#define CEF_API_HASH_PLATFORM "fe46b846c15428ca6b30c817778f710b810fba7b"
#define CEF_API_HASH_PLATFORM "83c4d72b1190a35bac919806c7e9b27b6a1efcf6"
#elif defined(OS_LINUX)
#define CEF_API_HASH_PLATFORM "57af9a254cb00b2a3cec85238942ee87fa53ef9d"
#define CEF_API_HASH_PLATFORM "f57499977f5166862b1f39ce22374b8e506b317b"
#endif
#ifdef __cplusplus

View File

@ -41,7 +41,6 @@
#include "include/cef_base.h"
#include "include/cef_client.h"
#include "include/cef_command_line.h"
#include "include/cef_print_handler.h"
#include "include/cef_values.h"
///
@ -86,13 +85,6 @@ class CefBrowserProcessHandler : public virtual CefBaseRefCounted {
virtual void OnBeforeChildProcessLaunch(
CefRefPtr<CefCommandLine> command_line) {}
///
// Return the handler for printing on Linux. If a print handler is not
// provided then printing will not be supported on the Linux platform.
///
/*--cef()--*/
virtual CefRefPtr<CefPrintHandler> GetPrintHandler() { return nullptr; }
///
// Called from any thread when work has been scheduled for the browser process
// main (UI) thread. This callback is used in combination with CefSettings.

View File

@ -51,6 +51,7 @@
#include "include/cef_keyboard_handler.h"
#include "include/cef_life_span_handler.h"
#include "include/cef_load_handler.h"
#include "include/cef_print_handler.h"
#include "include/cef_process_message.h"
#include "include/cef_render_handler.h"
#include "include/cef_request_handler.h"
@ -139,6 +140,13 @@ class CefClient : public virtual CefBaseRefCounted {
/*--cef()--*/
virtual CefRefPtr<CefLoadHandler> GetLoadHandler() { return nullptr; }
///
// Return the handler for printing on Linux. If a print handler is not
// provided then printing will not be supported on the Linux platform.
///
/*--cef()--*/
virtual CefRefPtr<CefPrintHandler> GetPrintHandler() { return nullptr; }
///
// Return the handler for off-screen rendering events.
///

View File

@ -133,7 +133,8 @@ class CefPrintHandler : public virtual CefBaseRefCounted {
// CefBrowserHost::PrintToPDF().
///
/*--cef()--*/
virtual CefSize GetPdfPaperSize(int device_units_per_inch) {
virtual CefSize GetPdfPaperSize(CefRefPtr<CefBrowser> browser,
int device_units_per_inch) {
return CefSize();
}
};