fix: delegate to PrintViewManagerBase on failed print (#34893)

fix: delegate to PrintViewManagerBase on failed print
This commit is contained in:
Shelley Vohr 2022-07-19 14:46:08 +02:00 committed by GitHub
parent eb8c9452cb
commit 05d4966251
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -163,12 +163,23 @@ void PrintViewManagerElectron::ScriptedPrint(
}
void PrintViewManagerElectron::ShowInvalidPrinterSettingsError() {
if (headless_jobs_.size() == 0) {
PrintViewManagerBase::ShowInvalidPrinterSettingsError();
return;
}
ReleaseJob(INVALID_PRINTER_SETTINGS);
}
void PrintViewManagerElectron::PrintingFailed(
int32_t cookie,
printing::mojom::PrintFailureReason reason) {
auto entry = std::find(headless_jobs_.begin(), headless_jobs_.end(), cookie);
if (entry == headless_jobs_.end()) {
PrintViewManagerBase::PrintingFailed(cookie, reason);
return;
}
ReleaseJob(reason == printing::mojom::PrintFailureReason::kInvalidPageRange
? PAGE_COUNT_EXCEEDED
: PRINTING_FAILED);