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

@@ -370,11 +370,6 @@ patches = [
# https://bitbucket.org/chromiumembedded/cef/issues/2196
'name': 'printing_context_2196',
},
{
# Expose the printing::GetRenderFrameHostToUse() method.
# https://bitbucket.org/chromiumembedded/cef/issues/3057
'name': 'printing_pdf_3047',
},
{
# Windows: Remove llvmlibthin as the combine_libs.py can't handle those.
# https://bitbucket.org/chromiumembedded/cef/issues/2470

View File

@@ -65,20 +65,6 @@ index cbb6c5925c2ae..f4faa42ca0b04 100644
}
auto* printer_query_ptr = printer_query.get();
printer_query_ptr->SetSettings(
diff --git chrome/browser/printing/print_view_manager_base.h chrome/browser/printing/print_view_manager_base.h
index ffbdbe363d956..9c3a5b9a9814f 100644
--- chrome/browser/printing/print_view_manager_base.h
+++ chrome/browser/printing/print_view_manager_base.h
@@ -204,9 +204,6 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
// Manages the low-level talk to the printer.
scoped_refptr<PrintJob> print_job_;
- private:
- friend class TestPrintViewManager;
-
// content::WebContentsObserver implementation.
void RenderFrameHostStateChanged(
content::RenderFrameHost* render_frame_host,
diff --git chrome/browser/resources/print_preview/ui/destination_dialog.html chrome/browser/resources/print_preview/ui/destination_dialog.html
index 5d1658999d5bb..d1b7b7288c946 100644
--- chrome/browser/resources/print_preview/ui/destination_dialog.html

View File

@@ -1,37 +0,0 @@
diff --git chrome/browser/printing/print_view_manager_common.cc chrome/browser/printing/print_view_manager_common.cc
index 06ebb78a547e1..8f470db9167f4 100644
--- chrome/browser/printing/print_view_manager_common.cc
+++ chrome/browser/printing/print_view_manager_common.cc
@@ -44,6 +44,8 @@ bool StoreFullPagePlugin(content::WebContents** result,
}
#endif // BUILDFLAG(ENABLE_EXTENSIONS)
+} // namespace
+
// Pick the right RenderFrameHost based on the WebContents.
content::RenderFrameHost* GetRenderFrameHostToUse(
content::WebContents* contents) {
@@ -57,8 +59,6 @@ content::RenderFrameHost* GetRenderFrameHostToUse(
return GetFrameToPrint(contents);
}
-} // namespace
-
void StartPrint(
content::WebContents* contents,
mojo::PendingAssociatedRemote<mojom::PrintRenderer> print_renderer,
diff --git chrome/browser/printing/print_view_manager_common.h chrome/browser/printing/print_view_manager_common.h
index c8ba345acce57..158baf9a5eda6 100644
--- chrome/browser/printing/print_view_manager_common.h
+++ chrome/browser/printing/print_view_manager_common.h
@@ -36,6 +36,10 @@ content::RenderFrameHost* GetFrameToPrint(content::WebContents* contents);
// guest's WebContents instead.
content::WebContents* GetWebContentsToUse(content::WebContents* contents);
+// Pick the right RenderFrameHost based on the WebContents.
+content::RenderFrameHost* GetRenderFrameHostToUse(
+ content::WebContents* contents);
+
} // namespace printing
#endif // CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_COMMON_H_