#include "printing/printing_context.h"
#include <utility>
#include "base/check_op.h"
#include "base/notreached.h"
#include "build/build_config.h"
#include "printing/buildflags/buildflags.h"
#include "printing/mojom/print.mojom.h"
#include "printing/page_setup.h"
#include "printing/print_job_constants.h"
#include "printing/print_settings_conversion.h"
#include "printing/printing_context_factory_for_test.h"
#include "printing/units.h"
#if BUILDFLAG(ENABLE_OOP_PRINTING)
#include "printing/printing_features.h"
#endif
namespace printing {
namespace {
PrintingContextFactoryForTest* g_printing_context_factory_for_test = …;
}
PrintingContext::PrintingContext(Delegate* delegate,
ProcessBehavior process_behavior)
: … { … }
PrintingContext::~PrintingContext() = default;
std::unique_ptr<PrintingContext> PrintingContext::Create(
Delegate* delegate,
ProcessBehavior process_behavior) { … }
void PrintingContext::SetPrintingContextFactoryForTest(
PrintingContextFactoryForTest* factory) { … }
void PrintingContext::set_margin_type(mojom::MarginType type) { … }
void PrintingContext::set_is_modifiable(bool is_modifiable) { … }
const PrintSettings& PrintingContext::settings() const { … }
void PrintingContext::ResetSettings() { … }
std::unique_ptr<PrintSettings> PrintingContext::TakeAndResetSettings() { … }
#if BUILDFLAG(ENABLE_OOP_PRINTING)
void PrintingContext::SetJobId(int job_id) { … }
#endif
mojom::ResultCode PrintingContext::OnError() { … }
void PrintingContext::SetDefaultPrintableAreaForVirtualPrinters() { … }
void PrintingContext::UsePdfSettings() { … }
mojom::ResultCode PrintingContext::UpdatePrintSettings(
base::Value::Dict job_settings) { … }
#if BUILDFLAG(IS_CHROMEOS)
mojom::ResultCode PrintingContext::UpdatePrintSettingsFromPOD(
std::unique_ptr<PrintSettings> job_settings) {
ResetSettings();
settings_ = std::move(job_settings);
return UpdatePrinterSettings({.show_system_dialog = false});
}
#endif
void PrintingContext::SetPrintSettings(const PrintSettings& settings) { … }
}