Use new PrintViewManagerBase::PrintToPdf method (fixes issue #3377)

This commit is contained in:
Marshall Greenblatt
2022-10-12 17:53:06 -04:00
parent 485f0b9caf
commit 25c75c5fc4
29 changed files with 324 additions and 753 deletions

View File

@ -13,7 +13,6 @@
#include "base/logging.h"
#include "base/notreached.h"
#include "chrome/browser/printing/print_view_manager_common.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_commands.h"
@ -185,30 +184,6 @@ void ChromeBrowserHostImpl::SetZoomLevel(double zoomLevel) {
NOTIMPLEMENTED();
}
void ChromeBrowserHostImpl::Print() {
if (!CEF_CURRENTLY_ON_UIT()) {
CEF_POST_TASK(CEF_UIT, base::BindOnce(&ChromeBrowserHostImpl::Print, this));
return;
}
if (browser_) {
// Like chrome::Print() but specifying the WebContents.
printing::StartPrint(GetWebContents(),
/*print_renderer=*/mojo::NullAssociatedRemote(),
browser_->profile()->GetPrefs()->GetBoolean(
prefs::kPrintPreviewDisabled),
/*has_selection=*/false);
}
}
void ChromeBrowserHostImpl::PrintToPDF(
const CefString& path,
const CefPdfPrintSettings& settings,
CefRefPtr<CefPdfPrintCallback> callback) {
NOTIMPLEMENTED();
callback->OnPdfPrintFinished(CefString(), false);
}
void ChromeBrowserHostImpl::Find(const CefString& searchText,
bool forward,
bool matchCase,