Commit fd3df7e8 authored by Jesse Schettler's avatar Jesse Schettler Committed by Commit Bot

arc: Send PrintRendererAssociatedPtr to PrintRenderFrameHelper

Send a PrintRendererAssociatedPtr to PrintRenderFrameHelper. When
present, the associated interface pointer will be used to render print
documents. An additional change will be made to perform the rendering.

        PrintViewManagerTest.*:PrintPreviewHandlerTest.*: \
        PrintPreviewUIUnitTest.*

Bug: b:140576300
Test: browser_tests --gtest_filter=PrintBrowserTest.*
Test: unit_tests --gtest_filter=PrintPreviewDialogControllerUnitTest.*: \
Change-Id: Id344d85cc1113f40a93a25c756290246905c4d3d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1789537Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Reviewed-by: default avatarYusuke Sato <yusukes@chromium.org>
Reviewed-by: default avatarSean Kau <skau@chromium.org>
Reviewed-by: default avatarDaniel Cheng <dcheng@chromium.org>
Commit-Queue: Jesse Schettler <jschettler@chromium.org>
Cr-Commit-Position: refs/heads/master@{#696986}
parent d1ccba88
...@@ -25,15 +25,15 @@ ...@@ -25,15 +25,15 @@
namespace arc { namespace arc {
// static // static
arc::mojom::PrintSessionHostPtr PrintSessionImpl::Create( mojom::PrintSessionHostPtr PrintSessionImpl::Create(
std::unique_ptr<content::WebContents> web_contents, std::unique_ptr<content::WebContents> web_contents,
std::unique_ptr<ash::ArcCustomTab> custom_tab, std::unique_ptr<ash::ArcCustomTab> custom_tab,
arc::mojom::PrintSessionInstancePtr instance) { mojom::PrintSessionInstancePtr instance) {
if (!custom_tab || !instance) if (!custom_tab || !instance)
return nullptr; return nullptr;
// This object will be deleted when the mojo connection is closed. // This object will be deleted when the mojo connection is closed.
arc::mojom::PrintSessionHostPtr ptr; mojom::PrintSessionHostPtr ptr;
new PrintSessionImpl(std::move(web_contents), std::move(custom_tab), new PrintSessionImpl(std::move(web_contents), std::move(custom_tab),
std::move(instance), mojo::MakeRequest(&ptr)); std::move(instance), mojo::MakeRequest(&ptr));
return ptr; return ptr;
...@@ -42,13 +42,14 @@ arc::mojom::PrintSessionHostPtr PrintSessionImpl::Create( ...@@ -42,13 +42,14 @@ arc::mojom::PrintSessionHostPtr PrintSessionImpl::Create(
PrintSessionImpl::PrintSessionImpl( PrintSessionImpl::PrintSessionImpl(
std::unique_ptr<content::WebContents> web_contents, std::unique_ptr<content::WebContents> web_contents,
std::unique_ptr<ash::ArcCustomTab> custom_tab, std::unique_ptr<ash::ArcCustomTab> custom_tab,
arc::mojom::PrintSessionInstancePtr instance, mojom::PrintSessionInstancePtr instance,
arc::mojom::PrintSessionHostRequest request) mojom::PrintSessionHostRequest request)
: ArcCustomTabModalDialogHost(std::move(custom_tab), : ArcCustomTabModalDialogHost(std::move(custom_tab),
std::move(web_contents)), std::move(web_contents)),
binding_(this, std::move(request)), instance_(std::move(instance)),
instance_(std::move(instance)) { print_renderer_binding_(this),
binding_.set_connection_error_handler( session_binding_(this, std::move(request)) {
session_binding_.set_connection_error_handler(
base::BindOnce(&PrintSessionImpl::Close, weak_ptr_factory_.GetWeakPtr())); base::BindOnce(&PrintSessionImpl::Close, weak_ptr_factory_.GetWeakPtr()));
web_contents_->SetUserData(UserDataKey(), base::WrapUnique(this)); web_contents_->SetUserData(UserDataKey(), base::WrapUnique(this));
...@@ -86,7 +87,10 @@ void PrintSessionImpl::OnPrintPreviewClosed() { ...@@ -86,7 +87,10 @@ void PrintSessionImpl::OnPrintPreviewClosed() {
} }
void PrintSessionImpl::StartPrintAfterDelay() { void PrintSessionImpl::StartPrintAfterDelay() {
printing::StartPrint(web_contents_.get(), false, false); printing::mojom::PrintRendererAssociatedPtrInfo print_renderer_ptr_info;
print_renderer_binding_.Bind(mojo::MakeRequest(&print_renderer_ptr_info));
printing::StartPrint(web_contents_.get(), std::move(print_renderer_ptr_info),
false, false);
} }
WEB_CONTENTS_USER_DATA_KEY_IMPL(PrintSessionImpl) WEB_CONTENTS_USER_DATA_KEY_IMPL(PrintSessionImpl)
......
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#include "components/arc/mojom/print_spooler.mojom.h" #include "components/arc/mojom/print_spooler.mojom.h"
#include "components/printing/common/print.mojom.h" #include "components/printing/common/print.mojom.h"
#include "content/public/browser/web_contents_user_data.h" #include "content/public/browser/web_contents_user_data.h"
#include "mojo/public/cpp/bindings/associated_binding.h"
#include "mojo/public/cpp/bindings/binding.h" #include "mojo/public/cpp/bindings/binding.h"
namespace ash { namespace ash {
...@@ -27,15 +28,15 @@ namespace arc { ...@@ -27,15 +28,15 @@ namespace arc {
// Implementation of PrintSessionHost interface. Also used by other classes to // Implementation of PrintSessionHost interface. Also used by other classes to
// send print-related messages to ARC. // send print-related messages to ARC.
class PrintSessionImpl : public arc::mojom::PrintSessionHost, class PrintSessionImpl : public mojom::PrintSessionHost,
public ArcCustomTabModalDialogHost, public ArcCustomTabModalDialogHost,
public content::WebContentsUserData<PrintSessionImpl>, public content::WebContentsUserData<PrintSessionImpl>,
public printing::mojom::PrintRenderer { public printing::mojom::PrintRenderer {
public: public:
static arc::mojom::PrintSessionHostPtr Create( static mojom::PrintSessionHostPtr Create(
std::unique_ptr<content::WebContents> web_contents, std::unique_ptr<content::WebContents> web_contents,
std::unique_ptr<ash::ArcCustomTab> custom_tab, std::unique_ptr<ash::ArcCustomTab> custom_tab,
arc::mojom::PrintSessionInstancePtr instance); mojom::PrintSessionInstancePtr instance);
~PrintSessionImpl() override; ~PrintSessionImpl() override;
...@@ -45,8 +46,8 @@ class PrintSessionImpl : public arc::mojom::PrintSessionHost, ...@@ -45,8 +46,8 @@ class PrintSessionImpl : public arc::mojom::PrintSessionHost,
private: private:
PrintSessionImpl(std::unique_ptr<content::WebContents> web_contents, PrintSessionImpl(std::unique_ptr<content::WebContents> web_contents,
std::unique_ptr<ash::ArcCustomTab> custom_tab, std::unique_ptr<ash::ArcCustomTab> custom_tab,
arc::mojom::PrintSessionInstancePtr instance, mojom::PrintSessionInstancePtr instance,
arc::mojom::PrintSessionHostRequest request); mojom::PrintSessionHostRequest request);
friend class content::WebContentsUserData<PrintSessionImpl>; friend class content::WebContentsUserData<PrintSessionImpl>;
// Used to close the ARC Custom Tab used for printing. If the remote end // Used to close the ARC Custom Tab used for printing. If the remote end
...@@ -57,12 +58,16 @@ class PrintSessionImpl : public arc::mojom::PrintSessionHost, ...@@ -57,12 +58,16 @@ class PrintSessionImpl : public arc::mojom::PrintSessionHost,
// Opens Chrome print preview after waiting for the PDF plugin to load. // Opens Chrome print preview after waiting for the PDF plugin to load.
void StartPrintAfterDelay(); void StartPrintAfterDelay();
// Used to send messages to ARC and request a new print document.
mojom::PrintSessionInstancePtr instance_;
// Binding for PrintRenderer.
mojo::AssociatedBinding<printing::mojom::PrintRenderer>
print_renderer_binding_;
// Used to bind the PrintSessionHost interface implementation to a message // Used to bind the PrintSessionHost interface implementation to a message
// pipe. // pipe.
mojo::Binding<arc::mojom::PrintSessionHost> binding_; mojo::Binding<mojom::PrintSessionHost> session_binding_;
// Used to send messages to ARC and request a new print document.
arc::mojom::PrintSessionInstancePtr instance_;
WEB_CONTENTS_USER_DATA_KEY_DECL(); WEB_CONTENTS_USER_DATA_KEY_DECL();
......
...@@ -195,6 +195,7 @@ class PrintBrowserTest : public InProcessBrowserTest { ...@@ -195,6 +195,7 @@ class PrintBrowserTest : public InProcessBrowserTest {
PrintPreviewObserver print_preview_observer; PrintPreviewObserver print_preview_observer;
StartPrint(browser()->tab_strip_model()->GetActiveWebContents(), StartPrint(browser()->tab_strip_model()->GetActiveWebContents(),
/*print_renderer=*/nullptr,
/*print_preview_disabled=*/false, print_only_selection); /*print_preview_disabled=*/false, print_only_selection);
print_preview_observer.WaitUntilPreviewIsReady(); print_preview_observer.WaitUntilPreviewIsReady();
...@@ -281,6 +282,7 @@ class PrintExtensionBrowserTest : public extensions::ExtensionBrowserTest { ...@@ -281,6 +282,7 @@ class PrintExtensionBrowserTest : public extensions::ExtensionBrowserTest {
PrintPreviewObserver print_preview_observer; PrintPreviewObserver print_preview_observer;
StartPrint(browser()->tab_strip_model()->GetActiveWebContents(), StartPrint(browser()->tab_strip_model()->GetActiveWebContents(),
/*print_renderer=*/nullptr,
/*print_preview_disabled=*/false, print_only_selection); /*print_preview_disabled=*/false, print_only_selection);
print_preview_observer.WaitUntilPreviewIsReady(); print_preview_observer.WaitUntilPreviewIsReady();
......
...@@ -110,24 +110,13 @@ bool PrintViewManager::BasicPrint(content::RenderFrameHost* rfh) { ...@@ -110,24 +110,13 @@ bool PrintViewManager::BasicPrint(content::RenderFrameHost* rfh) {
bool PrintViewManager::PrintPreviewNow(content::RenderFrameHost* rfh, bool PrintViewManager::PrintPreviewNow(content::RenderFrameHost* rfh,
bool has_selection) { bool has_selection) {
// Users can send print commands all they want and it is beyond return PrintPreview(rfh, nullptr, has_selection);
// PrintViewManager's control. Just ignore the extra commands. }
// See http://crbug.com/136842 for example.
if (print_preview_state_ != NOT_PREVIEWING)
return false;
// Don't print / print preview interstitials or crashed tabs.
if (IsInterstitialOrCrashed())
return false;
mojom::PrintRenderFrameAssociatedPtr print_render_frame;
rfh->GetRemoteAssociatedInterfaces()->GetInterface(&print_render_frame);
print_render_frame->InitiatePrintPreview(has_selection);
DCHECK(!print_preview_rfh_); bool PrintViewManager::PrintPreviewWithPrintRenderer(
print_preview_rfh_ = rfh; content::RenderFrameHost* rfh,
print_preview_state_ = USER_INITIATED_PREVIEW; mojom::PrintRendererAssociatedPtrInfo print_renderer) {
return true; return PrintPreview(rfh, std::move(print_renderer), false);
} }
void PrintViewManager::PrintPreviewForWebNode(content::RenderFrameHost* rfh) { void PrintViewManager::PrintPreviewForWebNode(content::RenderFrameHost* rfh) {
...@@ -203,6 +192,31 @@ void PrintViewManager::RenderFrameDeleted( ...@@ -203,6 +192,31 @@ void PrintViewManager::RenderFrameDeleted(
PrintViewManagerBase::RenderFrameDeleted(render_frame_host); PrintViewManagerBase::RenderFrameDeleted(render_frame_host);
} }
bool PrintViewManager::PrintPreview(
content::RenderFrameHost* rfh,
mojom::PrintRendererAssociatedPtrInfo print_renderer,
bool has_selection) {
// Users can send print commands all they want and it is beyond
// PrintViewManager's control. Just ignore the extra commands.
// See http://crbug.com/136842 for example.
if (print_preview_state_ != NOT_PREVIEWING)
return false;
// Don't print / print preview interstitials or crashed tabs.
if (IsInterstitialOrCrashed())
return false;
mojom::PrintRenderFrameAssociatedPtr print_render_frame;
rfh->GetRemoteAssociatedInterfaces()->GetInterface(&print_render_frame);
print_render_frame->InitiatePrintPreview(std::move(print_renderer),
has_selection);
DCHECK(!print_preview_rfh_);
print_preview_rfh_ = rfh;
print_preview_state_ = USER_INITIATED_PREVIEW;
return true;
}
void PrintViewManager::OnDidShowPrintDialog(content::RenderFrameHost* rfh) { void PrintViewManager::OnDidShowPrintDialog(content::RenderFrameHost* rfh) {
if (rfh != print_preview_rfh_) if (rfh != print_preview_rfh_)
return; return;
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "base/macros.h" #include "base/macros.h"
#include "chrome/browser/printing/print_view_manager_base.h" #include "chrome/browser/printing/print_view_manager_base.h"
#include "components/printing/common/print.mojom.h"
#include "content/public/browser/web_contents_user_data.h" #include "content/public/browser/web_contents_user_data.h"
#include "printing/buildflags/buildflags.h" #include "printing/buildflags/buildflags.h"
...@@ -33,12 +34,17 @@ class PrintViewManager : public PrintViewManagerBase, ...@@ -33,12 +34,17 @@ class PrintViewManager : public PrintViewManagerBase,
// preview dialog. // preview dialog.
bool BasicPrint(content::RenderFrameHost* rfh); bool BasicPrint(content::RenderFrameHost* rfh);
// Initiate print preview of the current document by first notifying the // Initiate print preview of the current document and specify whether a
// renderer. Since this happens asynchronous, the print preview dialog // selection or the entire frame is being printed.
// creation will not be completed on the return of this function. Returns
// false if print preview is impossible at the moment.
bool PrintPreviewNow(content::RenderFrameHost* rfh, bool has_selection); bool PrintPreviewNow(content::RenderFrameHost* rfh, bool has_selection);
// Initiate print preview of the current document and provide the renderer
// a printing::mojom::PrintRenderer to perform the actual rendering of
// the print document.
bool PrintPreviewWithPrintRenderer(
content::RenderFrameHost* rfh,
mojom::PrintRendererAssociatedPtrInfo print_renderer);
// Notify PrintViewManager that print preview is starting in the renderer for // Notify PrintViewManager that print preview is starting in the renderer for
// a particular WebNode. // a particular WebNode.
void PrintPreviewForWebNode(content::RenderFrameHost* rfh); void PrintPreviewForWebNode(content::RenderFrameHost* rfh);
...@@ -73,6 +79,15 @@ class PrintViewManager : public PrintViewManagerBase, ...@@ -73,6 +79,15 @@ class PrintViewManager : public PrintViewManagerBase,
struct FrameDispatchHelper; struct FrameDispatchHelper;
// Helper method for PrintPreviewNow() and PrintPreviewWithRenderer().
// Initiate print preview of the current document by first notifying the
// renderer. Since this happens asynchronously, the print preview dialog
// creation will not be completed on the return of this function. Returns
// false if print preview is impossible at the moment.
bool PrintPreview(content::RenderFrameHost* rfh,
mojom::PrintRendererAssociatedPtrInfo print_renderer,
bool has_selection);
// IPC Message handlers. // IPC Message handlers.
void OnDidShowPrintDialog(content::RenderFrameHost* rfh); void OnDidShowPrintDialog(content::RenderFrameHost* rfh);
void OnSetupScriptedPrintPreview(content::RenderFrameHost* rfh, void OnSetupScriptedPrintPreview(content::RenderFrameHost* rfh,
......
...@@ -50,6 +50,7 @@ content::RenderFrameHost* GetRenderFrameHostToUse( ...@@ -50,6 +50,7 @@ content::RenderFrameHost* GetRenderFrameHostToUse(
} // namespace } // namespace
void StartPrint(content::WebContents* contents, void StartPrint(content::WebContents* contents,
mojom::PrintRendererAssociatedPtrInfo print_renderer,
bool print_preview_disabled, bool print_preview_disabled,
bool has_selection) { bool has_selection) {
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
...@@ -71,7 +72,12 @@ void StartPrint(content::WebContents* contents, ...@@ -71,7 +72,12 @@ void StartPrint(content::WebContents* contents,
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
if (!print_preview_disabled) { if (!print_preview_disabled) {
print_view_manager->PrintPreviewNow(rfh_to_use, has_selection); if (print_renderer) {
print_view_manager->PrintPreviewWithPrintRenderer(
rfh_to_use, std::move(print_renderer));
} else {
print_view_manager->PrintPreviewNow(rfh_to_use, has_selection);
}
return; return;
} }
#endif // ENABLE_PRINT_PREVIEW #endif // ENABLE_PRINT_PREVIEW
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#ifndef CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_COMMON_H_ #ifndef CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_COMMON_H_
#define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_COMMON_H_ #define CHROME_BROWSER_PRINTING_PRINT_VIEW_MANAGER_COMMON_H_
#include "components/printing/common/print.mojom.h"
#include "printing/buildflags/buildflags.h" #include "printing/buildflags/buildflags.h"
namespace content { namespace content {
...@@ -15,7 +16,10 @@ class WebContents; ...@@ -15,7 +16,10 @@ class WebContents;
namespace printing { namespace printing {
// Start printing using the appropriate PrintViewManagerBase subclass. // Start printing using the appropriate PrintViewManagerBase subclass.
// Optionally provide a printing::mojom::PrintRenderer to render print
// documents.
void StartPrint(content::WebContents* web_contents, void StartPrint(content::WebContents* web_contents,
mojom::PrintRendererAssociatedPtrInfo print_renderer,
bool print_preview_disabled, bool print_preview_disabled,
bool has_selection); bool has_selection);
......
...@@ -47,7 +47,7 @@ class TestPrintViewManager : public PrintViewManagerBase { ...@@ -47,7 +47,7 @@ class TestPrintViewManager : public PrintViewManagerBase {
mojom::PrintRenderFrameAssociatedPtr print_render_frame; mojom::PrintRenderFrameAssociatedPtr print_render_frame;
rfh->GetRemoteAssociatedInterfaces()->GetInterface(&print_render_frame); rfh->GetRemoteAssociatedInterfaces()->GetInterface(&print_render_frame);
print_render_frame->InitiatePrintPreview(has_selection); print_render_frame->InitiatePrintPreview(nullptr, has_selection);
return true; return true;
} }
......
...@@ -2934,7 +2934,7 @@ void RenderViewContextMenu::ExecPrint() { ...@@ -2934,7 +2934,7 @@ void RenderViewContextMenu::ExecPrint() {
} }
printing::StartPrint( printing::StartPrint(
source_web_contents_, source_web_contents_, nullptr,
GetPrefs(browser_context_)->GetBoolean(prefs::kPrintPreviewDisabled), GetPrefs(browser_context_)->GetBoolean(prefs::kPrintPreviewDisabled),
!params_.selection_text.empty()); !params_.selection_text.empty());
#endif // BUILDFLAG(ENABLE_PRINTING) #endif // BUILDFLAG(ENABLE_PRINTING)
......
...@@ -971,7 +971,7 @@ void Print(Browser* browser) { ...@@ -971,7 +971,7 @@ void Print(Browser* browser) {
#if BUILDFLAG(ENABLE_PRINTING) #if BUILDFLAG(ENABLE_PRINTING)
auto* web_contents = browser->tab_strip_model()->GetActiveWebContents(); auto* web_contents = browser->tab_strip_model()->GetActiveWebContents();
printing::StartPrint( printing::StartPrint(
web_contents, web_contents, nullptr /* print_renderer */,
browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled), browser->profile()->GetPrefs()->GetBoolean(prefs::kPrintPreviewDisabled),
false /* has_selection? */); false /* has_selection? */);
#endif #endif
......
...@@ -15,6 +15,7 @@ interface PrintRenderer { ...@@ -15,6 +15,7 @@ interface PrintRenderer {
// printing grunt work for RenderView. // printing grunt work for RenderView.
interface PrintRenderFrame { interface PrintRenderFrame {
// Tells the RenderFrame to initiate print preview for the entire // Tells the RenderFrame to initiate print preview for the entire
// document. // document. Optionally provides a |print_renderer| to render print documents.
InitiatePrintPreview(bool has_selection); InitiatePrintPreview(associated PrintRenderer? print_renderer,
bool has_selection);
}; };
...@@ -1198,11 +1198,16 @@ void PrintRenderFrameHelper::OnPrintRenderFrameRequest( ...@@ -1198,11 +1198,16 @@ void PrintRenderFrameHelper::OnPrintRenderFrameRequest(
print_render_frame_binding_.Bind(std::move(request)); print_render_frame_binding_.Bind(std::move(request));
} }
void PrintRenderFrameHelper::InitiatePrintPreview(bool has_selection) { void PrintRenderFrameHelper::InitiatePrintPreview(
mojom::PrintRendererAssociatedPtrInfo print_renderer,
bool has_selection) {
#if BUILDFLAG(ENABLE_PRINT_PREVIEW) #if BUILDFLAG(ENABLE_PRINT_PREVIEW)
if (ipc_nesting_level_ > 1) if (ipc_nesting_level_ > 1)
return; return;
if (print_renderer)
print_renderer_.Bind(std::move(print_renderer));
blink::WebLocalFrame* frame = render_frame()->GetWebFrame(); blink::WebLocalFrame* frame = render_frame()->GetWebFrame();
// If we are printing a PDF extension frame, find the plugin node and print // If we are printing a PDF extension frame, find the plugin node and print
......
...@@ -199,7 +199,9 @@ class PrintRenderFrameHelper ...@@ -199,7 +199,9 @@ class PrintRenderFrameHelper
mojom::PrintRenderFrameAssociatedRequest request); mojom::PrintRenderFrameAssociatedRequest request);
// printing::mojom::PrintRenderFrame: // printing::mojom::PrintRenderFrame:
void InitiatePrintPreview(bool has_selection) override; void InitiatePrintPreview(
mojom::PrintRendererAssociatedPtrInfo print_renderer,
bool has_selection) override;
// Message handlers --------------------------------------------------------- // Message handlers ---------------------------------------------------------
void OnPrintPages(); void OnPrintPages();
...@@ -401,6 +403,10 @@ class PrintRenderFrameHelper ...@@ -401,6 +403,10 @@ class PrintRenderFrameHelper
// Used to check the prerendering status. // Used to check the prerendering status.
const std::unique_ptr<Delegate> delegate_; const std::unique_ptr<Delegate> delegate_;
// Used to render print documents from an external source (ARC, Crostini,
// etc.).
mojom::PrintRendererAssociatedPtr print_renderer_;
mojo::AssociatedBinding<mojom::PrintRenderFrame> print_render_frame_binding_; mojo::AssociatedBinding<mojom::PrintRenderFrame> print_render_frame_binding_;
// Keeps track of the state of print preview between messages. // Keeps track of the state of print preview between messages.
......
...@@ -261,7 +261,7 @@ class PrintRenderFrameHelperTestBase : public content::RenderViewTest { ...@@ -261,7 +261,7 @@ class PrintRenderFrameHelperTestBase : public content::RenderViewTest {
void OnPrintPreview(const base::DictionaryValue& dict) { void OnPrintPreview(const base::DictionaryValue& dict) {
PrintRenderFrameHelper* print_render_frame_helper = PrintRenderFrameHelper* print_render_frame_helper =
GetPrintRenderFrameHelper(); GetPrintRenderFrameHelper();
print_render_frame_helper->InitiatePrintPreview(false); print_render_frame_helper->InitiatePrintPreview(nullptr, false);
base::RunLoop run_loop; base::RunLoop run_loop;
DidPreviewPageListener filter(&run_loop); DidPreviewPageListener filter(&run_loop);
render_thread_->sink().AddFilter(&filter); render_thread_->sink().AddFilter(&filter);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment