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

@@ -67,8 +67,6 @@ void ClientAppBrowser::GetCookieableSchemes(std::vector<CefString>& schemes,
}
void ClientAppBrowser::OnContextInitialized() {
print_handler_ = CreatePrintHandler();
DelegateSet::iterator it = delegates_.begin();
for (; it != delegates_.end(); ++it)
(*it)->OnContextInitialized(this);

View File

@@ -40,10 +40,6 @@ class ClientAppBrowser : public ClientApp, public CefBrowserProcessHandler {
// client_app_delegates_browser.cc
static void CreateDelegates(DelegateSet& delegates);
// Create the Linux print handler. Implemented by cefclient in
// client_app_delegates_browser.cc
static CefRefPtr<CefPrintHandler> CreatePrintHandler();
// CefApp methods.
void OnBeforeCommandLineProcessing(
const CefString& process_type,
@@ -58,16 +54,11 @@ class ClientAppBrowser : public ClientApp, public CefBrowserProcessHandler {
void OnContextInitialized() OVERRIDE;
void OnBeforeChildProcessLaunch(
CefRefPtr<CefCommandLine> command_line) OVERRIDE;
CefRefPtr<CefPrintHandler> GetPrintHandler() OVERRIDE {
return print_handler_;
}
void OnScheduleMessagePumpWork(int64 delay) OVERRIDE;
// Set of supported Delegates.
DelegateSet delegates_;
CefRefPtr<CefPrintHandler> print_handler_;
IMPLEMENT_REFCOUNTING(ClientAppBrowser);
DISALLOW_COPY_AND_ASSIGN(ClientAppBrowser);
};