|
@@ -91,7 +91,7 @@ index 57c9c4408946066cd89304d50798a3719c8012d5..1c44d16c792a497623333ee4cb89005e
|
|
|
: PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3;
|
|
|
}
|
|
|
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
|
|
|
-index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b0828030494 100644
|
|
|
+index 6449b27ccbf58c26635830e8822c6ccbcf5a902d..f2f5c1f26335debc638184246be80c399d88dbce 100644
|
|
|
--- a/chrome/browser/printing/print_view_manager_base.cc
|
|
|
+++ b/chrome/browser/printing/print_view_manager_base.cc
|
|
|
@@ -22,7 +22,9 @@
|
|
@@ -245,7 +245,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
set_cookie(settings->params->document_cookie);
|
|
|
std::move(callback).Run(std::move(settings));
|
|
|
}
|
|
|
-@@ -497,7 +534,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
|
|
|
+@@ -501,7 +538,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
|
|
|
void PrintViewManagerBase::ScriptedPrintReply(
|
|
|
ScriptedPrintCallback callback,
|
|
|
int process_id,
|
|
@@ -255,7 +255,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
|
|
|
|
|
#if BUILDFLAG(ENABLE_OOP_PRINTING)
|
|
|
-@@ -512,12 +550,15 @@ void PrintViewManagerBase::ScriptedPrintReply(
|
|
|
+@@ -516,12 +554,15 @@ void PrintViewManagerBase::ScriptedPrintReply(
|
|
|
return;
|
|
|
}
|
|
|
|
|
@@ -273,7 +273,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-@@ -645,10 +686,12 @@ void PrintViewManagerBase::DidPrintDocument(
|
|
|
+@@ -649,10 +690,12 @@ void PrintViewManagerBase::DidPrintDocument(
|
|
|
void PrintViewManagerBase::GetDefaultPrintSettings(
|
|
|
GetDefaultPrintSettingsCallback callback) {
|
|
|
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
|
@@ -286,7 +286,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
#if BUILDFLAG(ENABLE_OOP_PRINTING)
|
|
|
if (features::ShouldPrintJobOop() &&
|
|
|
#if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS)
|
|
|
-@@ -700,10 +743,12 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
|
|
+@@ -704,10 +747,12 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
|
|
base::Value::Dict job_settings,
|
|
|
UpdatePrintSettingsCallback callback) {
|
|
|
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
|
@@ -299,7 +299,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
|
|
|
absl::optional<int> printer_type_value =
|
|
|
job_settings.FindInt(kSettingPrinterType);
|
|
|
-@@ -714,6 +759,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
|
|
+@@ -718,6 +763,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
|
|
|
|
|
mojom::PrinterType printer_type =
|
|
|
static_cast<mojom::PrinterType>(*printer_type_value);
|
|
@@ -307,7 +307,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
if (printer_type != mojom::PrinterType::kExtension &&
|
|
|
printer_type != mojom::PrinterType::kPdf &&
|
|
|
printer_type != mojom::PrinterType::kLocal) {
|
|
|
-@@ -733,6 +779,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
|
|
+@@ -737,6 +783,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
|
|
if (value > 0)
|
|
|
job_settings.Set(kSettingRasterizePdfDpi, value);
|
|
|
}
|
|
@@ -315,7 +315,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
|
|
|
std::unique_ptr<PrintSettings> print_settings =
|
|
|
PrintSettingsFromJobSettings(job_settings);
|
|
|
-@@ -752,7 +799,21 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
|
|
+@@ -756,7 +803,21 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -338,7 +338,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
// TODO(crbug.com/1424368): Remove this if the printable areas can be made
|
|
|
// fully available from `PrintBackend::GetPrinterSemanticCapsAndDefaults()`
|
|
|
// for in-browser queries.
|
|
|
-@@ -774,8 +835,6 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
|
|
+@@ -778,8 +839,6 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
|
|
}
|
|
|
#endif
|
|
|
|
|
@@ -347,7 +347,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
}
|
|
|
|
|
|
void PrintViewManagerBase::SetAccessibilityTree(
|
|
|
-@@ -791,7 +850,7 @@ void PrintViewManagerBase::SetAccessibilityTree(
|
|
|
+@@ -795,7 +854,7 @@ void PrintViewManagerBase::SetAccessibilityTree(
|
|
|
void PrintViewManagerBase::IsPrintingEnabled(
|
|
|
IsPrintingEnabledCallback callback) {
|
|
|
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
|
@@ -356,7 +356,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
}
|
|
|
|
|
|
void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
|
|
|
-@@ -807,13 +866,13 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
|
|
|
+@@ -811,13 +870,13 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
|
|
|
// didn't happen for some reason.
|
|
|
bad_message::ReceivedBadMessage(
|
|
|
render_process_host, bad_message::PVMB_SCRIPTED_PRINT_FENCED_FRAME);
|
|
@@ -372,7 +372,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
return;
|
|
|
}
|
|
|
#endif
|
|
|
-@@ -855,6 +914,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
|
|
|
+@@ -859,6 +918,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
|
|
|
|
|
|
PrintManager::PrintingFailed(cookie, reason);
|
|
|
|
|
@@ -380,7 +380,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
// `PrintingFailed()` can occur because asynchronous compositing results
|
|
|
// don't complete until after a print job has already failed and been
|
|
|
// destroyed. In such cases the error notification to the user will
|
|
|
-@@ -864,7 +924,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
|
|
|
+@@ -868,7 +928,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
|
|
|
print_job_->document()->cookie() == cookie) {
|
|
|
ShowPrintErrorDialogForGenericError();
|
|
|
}
|
|
@@ -389,7 +389,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
ReleasePrinterQuery();
|
|
|
}
|
|
|
|
|
|
-@@ -876,15 +936,24 @@ void PrintViewManagerBase::RemoveTestObserver(TestObserver& observer) {
|
|
|
+@@ -880,15 +940,24 @@ void PrintViewManagerBase::RemoveTestObserver(TestObserver& observer) {
|
|
|
test_observers_.RemoveObserver(&observer);
|
|
|
}
|
|
|
|
|
@@ -414,7 +414,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
}
|
|
|
|
|
|
void PrintViewManagerBase::RenderFrameDeleted(
|
|
|
-@@ -936,7 +1005,12 @@ void PrintViewManagerBase::OnJobDone() {
|
|
|
+@@ -940,7 +1009,12 @@ void PrintViewManagerBase::OnJobDone() {
|
|
|
// Printing is done, we don't need it anymore.
|
|
|
// print_job_->is_job_pending() may still be true, depending on the order
|
|
|
// of object registration.
|
|
@@ -428,7 +428,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
ReleasePrintJob();
|
|
|
}
|
|
|
|
|
|
-@@ -945,9 +1019,10 @@ void PrintViewManagerBase::OnCanceling() {
|
|
|
+@@ -949,9 +1023,10 @@ void PrintViewManagerBase::OnCanceling() {
|
|
|
}
|
|
|
|
|
|
void PrintViewManagerBase::OnFailed() {
|
|
@@ -440,7 +440,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
TerminatePrintJob(true);
|
|
|
}
|
|
|
|
|
|
-@@ -957,7 +1032,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
|
|
|
+@@ -961,7 +1036,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
|
|
|
|
|
|
// Is the document already complete?
|
|
|
if (print_job_->document() && print_job_->document()->IsComplete()) {
|
|
@@ -449,7 +449,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-@@ -1010,7 +1085,10 @@ bool PrintViewManagerBase::SetupNewPrintJob(
|
|
|
+@@ -1014,7 +1089,10 @@ bool PrintViewManagerBase::SetupNewPrintJob(
|
|
|
|
|
|
// Disconnect the current `print_job_`.
|
|
|
auto weak_this = weak_ptr_factory_.GetWeakPtr();
|
|
@@ -461,7 +461,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
if (!weak_this)
|
|
|
return false;
|
|
|
|
|
|
-@@ -1030,7 +1108,7 @@ bool PrintViewManagerBase::SetupNewPrintJob(
|
|
|
+@@ -1034,7 +1112,7 @@ bool PrintViewManagerBase::SetupNewPrintJob(
|
|
|
#endif
|
|
|
print_job_->AddObserver(*this);
|
|
|
|
|
@@ -470,7 +470,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
return true;
|
|
|
}
|
|
|
|
|
|
-@@ -1098,6 +1176,11 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
|
|
+@@ -1102,6 +1180,11 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
|
|
}
|
|
|
#endif
|
|
|
|
|
@@ -482,7 +482,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
if (!print_job_)
|
|
|
return;
|
|
|
|
|
|
-@@ -1105,7 +1188,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
|
|
+@@ -1109,7 +1192,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
|
|
// printing_rfh_ should only ever point to a RenderFrameHost with a live
|
|
|
// RenderFrame.
|
|
|
DCHECK(rfh->IsRenderFrameLive());
|
|
@@ -491,7 +491,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
}
|
|
|
|
|
|
print_job_->RemoveObserver(*this);
|
|
|
-@@ -1147,7 +1230,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
|
|
+@@ -1151,7 +1234,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
|
|
}
|
|
|
|
|
|
bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
|
|
@@ -500,7 +500,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
return true;
|
|
|
|
|
|
if (!cookie) {
|
|
|
-@@ -1293,7 +1376,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() {
|
|
|
+@@ -1297,7 +1380,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() {
|
|
|
}
|
|
|
|
|
|
void PrintViewManagerBase::CompletePrintNow(content::RenderFrameHost* rfh) {
|
|
@@ -509,7 +509,7 @@ index 5c39228c38530a7a631f94a6de3d2f607162650b..442a6f841e1e234413888c0b64d34b08
|
|
|
|
|
|
for (auto& observer : GetTestObservers()) {
|
|
|
observer.OnPrintNow(rfh);
|
|
|
-@@ -1343,7 +1426,7 @@ void PrintViewManagerBase::CompleteScriptedPrintAfterContentAnalysis(
|
|
|
+@@ -1347,7 +1430,7 @@ void PrintViewManagerBase::CompleteScriptedPrintAfterContentAnalysis(
|
|
|
set_analyzing_content(/*analyzing=*/false);
|
|
|
if (!allowed || !printing_rfh_ || IsCrashed() ||
|
|
|
!printing_rfh_->IsRenderFrameLive()) {
|