#include "chrome/browser/printing/test_print_view_manager.h"
#include <functional>
#include <memory>
#include <utility>
#include "base/check.h"
#include "base/functional/bind.h"
#include "base/run_loop.h"
#include "build/build_config.h"
#include "chrome/browser/printing/print_job.h"
#include "chrome/browser/printing/print_job_manager.h"
#include "chrome/browser/printing/print_view_manager_common.h"
#include "chrome/browser/printing/printer_query.h"
#include "components/printing/browser/print_manager_utils.h"
#include "components/printing/common/print.mojom.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/render_frame_host.h"
#include "printing/mojom/print.mojom.h"
#include "printing/print_settings.h"
#if BUILDFLAG(IS_WIN)
#include "printing/metafile.h"
#include "printing/print_job_constants.h"
#endif
namespace printing {
namespace {
void OnDidUpdatePrintSettings(
mojom::PrintPagesParamsPtr& snooped_params,
mojom::PrintManagerHost::UpdatePrintSettingsCallback callback,
mojom::PrintPagesParamsPtr settings) { … }
class TestPrintJob : public PrintJob { … };
}
TestPrintViewManager::TestPrintViewManager(content::WebContents* web_contents)
: … { … }
TestPrintViewManager::TestPrintViewManager(content::WebContents* web_contents,
OnDidCreatePrintJobCallback callback)
: … { … }
TestPrintViewManager::~TestPrintViewManager() = default;
bool TestPrintViewManager::StartPrinting(content::WebContents* contents) { … }
void TestPrintViewManager::WaitUntilPreviewIsShownOrCancelled() { … }
TestPrintViewManager* TestPrintViewManager::CreateForWebContents(
content::WebContents* web_contents) { … }
bool TestPrintViewManager::PrintNow(content::RenderFrameHost* rfh) { … }
scoped_refptr<PrintJob> TestPrintViewManager::CreatePrintJob(
PrintJobManager* print_job_manager) { … }
void TestPrintViewManager::PrintPreviewRejectedForTesting() { … }
void TestPrintViewManager::PrintPreviewAllowedForTesting() { … }
void TestPrintViewManager::UpdatePrintSettings(
base::Value::Dict job_settings,
UpdatePrintSettingsCallback callback) { … }
}