chore: bump chromium to 113.0.5636.0 (main) (#37130)
* chore: bump chromium in DEPS to 112.0.5576.0 * 4211172: Use the Mac ImageTransportSurface on iOS.4211172
* 4191759: Reuse PrintBackend process from query for printing4191759
* 4189718: Revert "[code health] Remove NotificationService use by SpellcheckService"4189718
* 4216074: web_contents_delegate: remove content::4216074
* 4192284: ios: Add feature flag for PartitionAlloc.4192284
* chore: bump chromium in DEPS to 112.0.5578.0 * 4211172: Use the Mac ImageTransportSurface on iOS.4211172
* 4067682: Define ThirdPartyCookiesUserBypass runtime feature and plumb it through to URLRequest.cookie_setting_overrides.4067682
* chore: fixup patch indices * 4218354: Disable the use of preserve_most on arm64 Windows4218354
* chore: fixup patch indices * chore: bump chromium in DEPS to 112.0.5579.0 * chore: update patches * chore: bump chromium in DEPS to 112.0.5581.0 * chore: update patches * refactor: use modern base values in tracing Ref:4210912
* refactor: remove GetFontLookupTableCacheDir Ref:4191820
* refactor: base value type DICTIONARY replaced with DICT Ref:4198081
* chore: add stub impls for WCO routing Refs:4182690
* refactor: rename latency metrics Refs:4048262
* refactor: add sanitized context to clipboard write Ref:4178264
* refactor: s/Rect/WindowFeatures Ref:4167001
* refacotr: switch mojom::NetworkHintsHandler to use SchemeHostPair instead of URL Ref:4185417
* chore: remove dead DecodeToken code * refactor: refactoring geolocation manager Ref:4161603
* chore: iwyu net/cert/cert_verify_result.h * build: use xcode 14 * chore: bump chromium in DEPS to 112.0.5583.0 * chore: update patches * chore: fixup mas patches * refactor: base::span explicit conversion checks Ref:4219636
* chore: bump chromium in DEPS to 112.0.5591.0 * chore: bump chromium in DEPS to 112.0.5593.0 * chore: bump chromium in DEPS to 112.0.5594.3 * chore: bump chromium in DEPS to 112.0.5597.0 * chore: update chromium patches * 4242507: Move most of GetChromeKeySystems() into components/cdm Ref:4242507
It seems as though the bug this patch was trying to resolve is now fixed. * chore: update v8 patches * 4240798: Get rid of ShowInvalidPrinterSettingsError() in PrintManagerHost. Ref:4240798
* 4247938: Bump min required GTK version to 3.20 Ref:4247938
* 4173660: Remove unused argument in BeforeUnloadCompleted Ref:4173660
* 4226656: Add response url to SimpleURLLoader::OnRedirectCallback Ref:4226656
* fixup!: 4240798: Get rid of ShowInvalidPrinterSettingsError() in PrintManager Host. Ref:4240798
* chore: bump chromium in DEPS to 112.0.5599.0 * chore: update patches * 4251237: [StorageKey Cleanup] (2) Rename CreateFirstParty constructors Ref:4251237
* 4256866: [Extensions] Replace GetHooksForAPI with a RegisterHooksDelegate Ref:4256866
* chore: bump chromium in DEPS to 112.0.5601.0 * chore: update patches * chore: bump chromium in DEPS to 112.0.5603.0 * chore: bump chromium in DEPS to 112.0.5605.0 * chore: bump chromium in DEPS to 112.0.5607.0 * update patches * fix mas patch * chore: bump chromium in DEPS to 112.0.5609.0 * chore: update patches * build: update appveyor image 4072083: New toolchain for Windows 11 10.0.22621.755 SDK |4072083
* chore: bump chromium in DEPS to 112.0.5611.0 * fix patches * chore: update patches * 4261434: Remove browser_watcher (1/3): Move ExitCodeWatcher to chrome/app4261434
* 4258446: Move network::mojom::ClearDataFilter to its own mojom file4258446
* 4128591: Enable large pdbs by default4128591
* move dbgcore/dbghelp to extensions_to_skip * chore: bump chromium in DEPS to 113.0.5624.0 * chore: bump chromium in DEPS to 113.0.5626.0 * chore: bump chromium in DEPS to 113.0.5628.2 * chore: bump chromium in DEPS to 113.0.5630.0 * chore: bump chromium in DEPS to 113.0.5632.0 * chore: bump chromium in DEPS to 113.0.5634.0 * chore: bump chromium in DEPS to 113.0.5636.0 * 4255184: Permit popups from fullscreen-within-tab openers4255184
* 4297715: [mac] Introduce BluetoothLowEnergyAdapterApple to reuse CoreBluetooth4297715
* 4301154: Remove GLContextCGL and cleanup relevant code4301154
* 4278389: CDP: fix Page.addScriptToEvaluateOnNewDocument in iframes4278389
* 4240798: Get rid of ShowInvalidPrinterSettingsError() in PrintManagerHost.4240798
* 4291989: Refactor logic determining untrusted mojo invitation flag.4291989
* 4110189: Add Select option to content touch selection menu.4110189
* 4309923: [Extensions] Add a unit test for API permissions having features4309923
* 4282657: Revert "[headless] Route stdio to parent console on Windows."4282657
* 4306685: [v8] Improve V8 flag configuration to avoid errors4306685
* 4295455: Add fallback Linux UI for when GTK 3.20 isn't available4295455
* 4289774: Remove feature for shared sandbox policies4289774
* 4292705: Rename WebSwapCGLLayer to ANGLESwapCGLLayer outside WebKit.4292705
* chore: fixup patch indices * fixup! 4297715: [mac] Introduce BluetoothLowEnergyAdapterApple to reuse CoreBluetooth * 4289789: Remove base::JSONReader::ReadDeprecated4289789
* 4281521: Remove `base::Value::FindKey()`4281521
* 4276761: Update NAK constructor and GetIsCrossSite4276761
* 4288119: Let GetUpload work with UploadInfo pointers4288119
* 4285322: content: Move WebExposedIsolationLevel to its own public header4285322
* 4251818: [Extensions] Make ExtensionSet moveable.4251818
* 4299554: [json-schema-compiler] Refactor to Params::Create (14/74)4299554
* chore: update printing patch indices * chore: update chromium/add_maximized_parameter_to_linuxui_getwindowframeprovider.patch Xref:4295455
Our patch changes the signature of `LinuxUiTheme::GetWindowFrameProvider()`. Upstream 4295455 added a new subclass (FallbackLinuxUi) so sync its version of GetWindowFrameProvider() to match our changes. * chore: disable node test parallel/test-intl Disabling the test because upstream is still working on this feature. Xref:4237675
Xref: https://bugs.chromium.org/p/chromium/issues/detail?id=1414292 When upstream churn is done we should re-enable this test and update it as necessary. * win7dep: Remove ResolveCoreWinRTStringDelayload Xref:4277708
Upstream has removed this since Win7 support is deprecated. This updates our `language_util_win.cc` file using the same approach that 4277708 uses for `base/win/win_util.cc`. * fix: remove use of ResolveCoreWinRTDelayload() Xref:4297979
A followup to prev commit, which removed ResolveCoreWinRTStringDelayload(). This PR follows the 4297979 approach of simply removing the calls, e.g.4297979/4/chrome/browser/device_reauth/win/authenticator_win.cc
* fix: add d3dcompiler_47 to the zip manifest Xref:4285717
Xref (24-x-y):0fb1def32b
* This clang roll breaks Linux arm 32-bit Xref (24-x-y):1229114494
Xref (chromium): https://crbug.com/1410101 * fix: WebUSB on ARM64 macs (#37441) * chore: update patches * chore: fix macOS CI build. Xref:4278307
That whole dir was previously being removed to save space since we don't use it. We still don't use anything in the file, but gn needs it to exist. * fixup! chore: fix macOS CI build. chore: mkdir --parents does not exist on BSD; use mkdir -p * chore: update chromium/mas_disable_remote_accessibility.patch Xref:4273450
Upstream added a new block of code using NSAccessibilityRemoteUIElement, so stub it out with `#if !IS_MAS_BUILD()` same as we do everwhere else. * chore: address code review nit :) --------- Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: Samuel Attard <marshallofsound@electronjs.org> Co-authored-by: Keeley Hammond <vertedinde@electronjs.org> Co-authored-by: Jeremy Rose <jeremya@chromium.org> Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org>
This commit is contained in:
parent
8ee58e18fd
commit
feaf18e371
154 changed files with 1049 additions and 1106 deletions
|
@ -11,10 +11,10 @@ majority of changes originally come from these PRs:
|
|||
This patch also fixes callback for manual user cancellation and success.
|
||||
|
||||
diff --git a/BUILD.gn b/BUILD.gn
|
||||
index e8b687fa8db81d22d04bae5302b8514bed6053d3..0b67e532df8864e6e9b6c054d6d3225f63447f9d 100644
|
||||
index 6b65400bab39cd71bb043ff05f1a08b8e6af94c1..e547499b5670bb1125cdac276cc4e29d8bf4dd9d 100644
|
||||
--- a/BUILD.gn
|
||||
+++ b/BUILD.gn
|
||||
@@ -956,7 +956,6 @@ if (is_win) {
|
||||
@@ -965,7 +965,6 @@ if (is_win) {
|
||||
"//media:media_unittests",
|
||||
"//media/midi:midi_unittests",
|
||||
"//net:net_unittests",
|
||||
|
@ -22,7 +22,7 @@ index e8b687fa8db81d22d04bae5302b8514bed6053d3..0b67e532df8864e6e9b6c054d6d3225f
|
|||
"//sql:sql_unittests",
|
||||
"//third_party/breakpad:symupload($host_toolchain)",
|
||||
"//ui/base:ui_base_unittests",
|
||||
@@ -965,6 +964,10 @@ if (is_win) {
|
||||
@@ -974,6 +973,10 @@ if (is_win) {
|
||||
"//ui/views:views_unittests",
|
||||
"//url:url_unittests",
|
||||
]
|
||||
|
@ -34,7 +34,7 @@ index e8b687fa8db81d22d04bae5302b8514bed6053d3..0b67e532df8864e6e9b6c054d6d3225f
|
|||
}
|
||||
|
||||
diff --git a/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc
|
||||
index e1ddd8fc237f61ceb86115d66087a6f89940609f..3631a378c2829a6007d86a2b934ee0f4fd055156 100644
|
||||
index 044b34d3738985f3e38476c37a189a5c06ed5353..8cf9832ca1ba864860bccb9b8cb4180da0f1cb29 100644
|
||||
--- a/chrome/browser/printing/print_job.cc
|
||||
+++ b/chrome/browser/printing/print_job.cc
|
||||
@@ -91,6 +91,7 @@ bool PrintWithReducedRasterization(PrefService* prefs) {
|
||||
|
@ -53,7 +53,7 @@ index e1ddd8fc237f61ceb86115d66087a6f89940609f..3631a378c2829a6007d86a2b934ee0f4
|
|||
|
||||
#endif // BUILDFLAG(IS_WIN)
|
||||
|
||||
@@ -359,8 +361,10 @@ void PrintJob::StartPdfToEmfConversion(
|
||||
@@ -374,8 +376,10 @@ void PrintJob::StartPdfToEmfConversion(
|
||||
|
||||
const PrintSettings& settings = document()->settings();
|
||||
|
||||
|
@ -65,7 +65,7 @@ index e1ddd8fc237f61ceb86115d66087a6f89940609f..3631a378c2829a6007d86a2b934ee0f4
|
|||
|
||||
using RenderMode = PdfRenderSettings::Mode;
|
||||
RenderMode mode = print_with_reduced_rasterization
|
||||
@@ -450,8 +454,10 @@ void PrintJob::StartPdfToPostScriptConversion(
|
||||
@@ -465,8 +469,10 @@ void PrintJob::StartPdfToPostScriptConversion(
|
||||
if (ps_level2) {
|
||||
mode = PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2;
|
||||
} else {
|
||||
|
@ -78,28 +78,20 @@ index e1ddd8fc237f61ceb86115d66087a6f89940609f..3631a378c2829a6007d86a2b934ee0f4
|
|||
: 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 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab6a293880 100644
|
||||
index a2adc3c992aba745c75ba413095165711cb01413..766b546c64dec299ecc6aae87443c13096c29d82 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.cc
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.cc
|
||||
@@ -29,8 +29,6 @@
|
||||
#include "chrome/browser/printing/print_view_manager_common.h"
|
||||
#include "chrome/browser/printing/printer_query.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
-#include "chrome/browser/ui/simple_message_box.h"
|
||||
-#include "chrome/browser/ui/webui/print_preview/printer_handler.h"
|
||||
#include "chrome/common/pref_names.h"
|
||||
#include "chrome/grit/generated_resources.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
@@ -57,7 +55,7 @@
|
||||
#include "printing/printing_utils.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
|
||||
-#if !BUILDFLAG(IS_ANDROID)
|
||||
+#if 0 // Electron does not implement this function.
|
||||
@@ -22,7 +22,9 @@
|
||||
#include "chrome/browser/bad_message.h"
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
+#if 0 // Electron does not use Chrome error dialogs
|
||||
#include "chrome/browser/printing/print_error_dialog.h"
|
||||
#endif
|
||||
|
||||
@@ -81,10 +79,23 @@ namespace printing {
|
||||
+#endif
|
||||
#include "chrome/browser/printing/print_job.h"
|
||||
#include "chrome/browser/printing/print_job_manager.h"
|
||||
#include "chrome/browser/printing/print_view_manager_common.h"
|
||||
@@ -77,6 +79,17 @@ namespace printing {
|
||||
|
||||
namespace {
|
||||
|
||||
|
@ -117,40 +109,28 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
using PrintSettingsCallback =
|
||||
base::OnceCallback<void(std::unique_ptr<PrinterQuery>)>;
|
||||
|
||||
void ShowWarningMessageBox(const std::u16string& message) {
|
||||
+ LOG(ERROR) << "Invalid printer settings " << message;
|
||||
+#if 0
|
||||
// Runs always on the UI thread.
|
||||
static bool is_dialog_shown = false;
|
||||
if (is_dialog_shown)
|
||||
@@ -93,6 +104,7 @@ void ShowWarningMessageBox(const std::u16string& message) {
|
||||
base::AutoReset<bool> auto_reset(&is_dialog_shown, true);
|
||||
|
||||
chrome::ShowWarningMessageBox(nullptr, std::u16string(), message);
|
||||
+#endif
|
||||
}
|
||||
|
||||
void OnDidGetDefaultPrintSettings(
|
||||
@@ -140,7 +152,9 @@ void OnDidUpdatePrintSettings(
|
||||
@@ -87,15 +100,18 @@ void OnDidGetDefaultPrintSettings(
|
||||
mojom::PrintManagerHost::GetDefaultPrintSettingsCallback callback) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
DCHECK(printer_query);
|
||||
mojom::PrintPagesParamsPtr params = CreateEmptyPrintPagesParamsPtr();
|
||||
- if (printer_query->last_status() == mojom::ResultCode::kSuccess) {
|
||||
mojom::PrintParamsPtr params = mojom::PrintParams::New();
|
||||
- if (printer_query &&
|
||||
- printer_query->last_status() == mojom::ResultCode::kSuccess) {
|
||||
+ // We call update without first printing from defaults,
|
||||
+ // so the last printer status will still be defaulted to PrintingContext::FAILED
|
||||
+ if (printer_query) {
|
||||
RenderParamsFromPrintSettings(printer_query->settings(),
|
||||
params->params.get());
|
||||
params->params->document_cookie = printer_query->cookie();
|
||||
@@ -166,6 +180,7 @@ void OnDidScriptedPrint(
|
||||
mojom::PrintManagerHost::ScriptedPrintCallback callback) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
mojom::PrintPagesParamsPtr params = CreateEmptyPrintPagesParamsPtr();
|
||||
+
|
||||
if (printer_query->last_status() == mojom::ResultCode::kSuccess &&
|
||||
printer_query->settings().dpi()) {
|
||||
RenderParamsFromPrintSettings(printer_query->settings(),
|
||||
@@ -175,7 +190,8 @@ void OnDidScriptedPrint(
|
||||
RenderParamsFromPrintSettings(printer_query->settings(), params.get());
|
||||
params->document_cookie = printer_query->cookie();
|
||||
}
|
||||
|
||||
+#if 0 // Electron does not use Chrome error dialogs
|
||||
if (!want_pdf_settings && !PrintMsgPrintParamsIsValid(*params)) {
|
||||
ShowPrintErrorDialogForInvalidPrinterError();
|
||||
}
|
||||
+#endif
|
||||
|
||||
std::move(callback).Run(std::move(params));
|
||||
|
||||
@@ -165,7 +181,8 @@ void OnDidScriptedPrint(
|
||||
}
|
||||
bool has_valid_cookie = params->params->document_cookie;
|
||||
bool has_dpi = !params->params->dpi.IsEmpty();
|
||||
|
@ -160,19 +140,20 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
|
||||
if (has_dpi && has_valid_cookie) {
|
||||
queue->QueuePrinterQuery(std::move(printer_query));
|
||||
@@ -188,9 +204,11 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
|
||||
@@ -178,9 +195,11 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
|
||||
: PrintManager(web_contents),
|
||||
queue_(g_browser_process->print_job_manager()->queue()) {
|
||||
DCHECK(queue_);
|
||||
+#if 0 // Printing is always enabled.
|
||||
Profile* profile =
|
||||
Profile::FromBrowserContext(web_contents->GetBrowserContext());
|
||||
printing_enabled_.Init(prefs::kPrintingEnabled, profile->GetPrefs());
|
||||
- printing_enabled_.Init(prefs::kPrintingEnabled, profile->GetPrefs());
|
||||
+ printing_enabled_.Init(prefs::kPrintingEnabled, profile->GetPrefs());
|
||||
+#endif
|
||||
}
|
||||
|
||||
PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
@@ -198,7 +216,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
@@ -188,7 +207,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
DisconnectFromCurrentPrintJob();
|
||||
}
|
||||
|
||||
|
@ -184,19 +165,20 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
// Remember the ID for `rfh`, to enable checking that the `RenderFrameHost`
|
||||
// is still valid after a possible inner message loop runs in
|
||||
// `DisconnectFromCurrentPrintJob()`.
|
||||
@@ -226,7 +247,10 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
|
||||
@@ -216,7 +238,12 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
|
||||
#endif
|
||||
|
||||
SetPrintingRFH(rfh);
|
||||
- CompletePrintNow(rfh);
|
||||
+ //CompletePrintNow(rfh);
|
||||
+#if 0
|
||||
CompletePrintNow(rfh);
|
||||
+#endif
|
||||
+ callback_ = std::move(callback);
|
||||
+
|
||||
+ GetPrintRenderFrame(rfh)->PrintRequestedPages(silent, std::move(settings));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -384,7 +408,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
|
||||
@@ -388,7 +415,8 @@ void PrintViewManagerBase::GetDefaultPrintSettingsReply(
|
||||
void PrintViewManagerBase::ScriptedPrintReply(
|
||||
ScriptedPrintCallback callback,
|
||||
int process_id,
|
||||
|
@ -206,7 +188,7 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
|
||||
#if BUILDFLAG(ENABLE_OOP_PRINTING)
|
||||
@@ -399,8 +424,11 @@ void PrintViewManagerBase::ScriptedPrintReply(
|
||||
@@ -414,8 +442,11 @@ void PrintViewManagerBase::ScriptedPrintReply(
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -219,12 +201,11 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
}
|
||||
|
||||
void PrintViewManagerBase::NavigationStopped() {
|
||||
@@ -535,11 +563,14 @@ void PrintViewManagerBase::DidPrintDocument(
|
||||
@@ -550,11 +581,13 @@ void PrintViewManagerBase::DidPrintDocument(
|
||||
void PrintViewManagerBase::GetDefaultPrintSettings(
|
||||
GetDefaultPrintSettingsCallback callback) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
+#if 0 // Printing is always enabled.
|
||||
+
|
||||
if (!printing_enabled_.GetValue()) {
|
||||
GetDefaultPrintSettingsReply(std::move(callback),
|
||||
mojom::PrintParams::New());
|
||||
|
@ -234,7 +215,7 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
#if BUILDFLAG(ENABLE_OOP_PRINTING)
|
||||
if (printing::features::kEnableOopPrintDriversJobPrint.Get() &&
|
||||
#if BUILDFLAG(ENABLE_PRINT_CONTENT_ANALYSIS)
|
||||
@@ -588,18 +619,20 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
@@ -603,11 +636,13 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
base::Value::Dict job_settings,
|
||||
UpdatePrintSettingsCallback callback) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
|
@ -244,11 +225,11 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
CreateEmptyPrintPagesParamsPtr(), false);
|
||||
return;
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
|
||||
if (!job_settings.FindInt(kSettingPrinterType)) {
|
||||
UpdatePrintSettingsReply(std::move(callback),
|
||||
CreateEmptyPrintPagesParamsPtr(), false);
|
||||
@@ -615,6 +650,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -256,7 +237,7 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
content::BrowserContext* context =
|
||||
web_contents() ? web_contents()->GetBrowserContext() : nullptr;
|
||||
PrefService* prefs =
|
||||
@@ -609,6 +642,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
@@ -624,6 +660,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
if (value > 0)
|
||||
job_settings.Set(kSettingRasterizePdfDpi, value);
|
||||
}
|
||||
|
@ -264,7 +245,7 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
|
||||
auto callback_wrapper =
|
||||
base::BindOnce(&PrintViewManagerBase::UpdatePrintSettingsReply,
|
||||
@@ -630,7 +664,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
@@ -645,7 +682,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
void PrintViewManagerBase::IsPrintingEnabled(
|
||||
IsPrintingEnabledCallback callback) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
|
@ -273,7 +254,7 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
}
|
||||
|
||||
void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
|
||||
@@ -646,14 +680,14 @@ void PrintViewManagerBase::ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
|
||||
@@ -661,14 +698,14 @@ 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);
|
||||
|
@ -283,35 +264,42 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
}
|
||||
#if BUILDFLAG(ENABLE_OOP_PRINTING)
|
||||
if (printing::features::kEnableOopPrintDriversJobPrint.Get() &&
|
||||
!service_manager_client_id_.has_value()) {
|
||||
!query_with_ui_client_id_.has_value()) {
|
||||
// Renderer process has requested settings outside of the expected setup.
|
||||
- std::move(callback).Run(CreateEmptyPrintPagesParamsPtr());
|
||||
+ std::move(callback).Run(CreateEmptyPrintPagesParamsPtr(), false);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
@@ -691,7 +725,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
|
||||
@@ -706,6 +743,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
|
||||
|
||||
PrintManager::PrintingFailed(cookie, reason);
|
||||
|
||||
-#if !BUILDFLAG(IS_ANDROID) // Android does not implement this function.
|
||||
+#if 0 // Electron does not implement this function.
|
||||
+#if 0 // Electron does not use Chromium error dialogs
|
||||
// `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
|
||||
@@ -715,6 +749,11 @@ void PrintViewManagerBase::RemoveObserver(Observer& observer) {
|
||||
@@ -715,7 +753,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie,
|
||||
print_job_->document()->cookie() == cookie) {
|
||||
ShowPrintErrorDialogForGenericError();
|
||||
}
|
||||
-
|
||||
+#endif
|
||||
ReleasePrinterQuery();
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::ShowInvalidPrinterSettingsError() {
|
||||
@@ -727,15 +765,24 @@ void PrintViewManagerBase::RemoveObserver(Observer& observer) {
|
||||
observers_.RemoveObserver(&observer);
|
||||
}
|
||||
|
||||
+void PrintViewManagerBase::ShowInvalidPrinterSettingsError() {
|
||||
+ if (!callback_.is_null()) {
|
||||
+ printing_status_ = PrintStatus::kInvalid;
|
||||
+ TerminatePrintJob(true);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
base::SingleThreadTaskRunner::GetCurrentDefault()->PostTask(
|
||||
FROM_HERE, base::BindOnce(&ShowWarningMessageBox,
|
||||
l10n_util::GetStringUTF16(
|
||||
@@ -725,11 +764,13 @@ void PrintViewManagerBase::RenderFrameHostStateChanged(
|
||||
void PrintViewManagerBase::RenderFrameHostStateChanged(
|
||||
content::RenderFrameHost* render_frame_host,
|
||||
content::RenderFrameHost::LifecycleState /*old_state*/,
|
||||
content::RenderFrameHost::LifecycleState new_state) {
|
||||
|
@ -325,7 +313,7 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
}
|
||||
|
||||
void PrintViewManagerBase::RenderFrameDeleted(
|
||||
@@ -781,12 +822,17 @@ void PrintViewManagerBase::OnJobDone() {
|
||||
@@ -787,7 +834,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.
|
||||
|
@ -339,13 +327,19 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
ReleasePrintJob();
|
||||
}
|
||||
|
||||
@@ -796,9 +848,10 @@ void PrintViewManagerBase::OnCanceling() {
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::OnFailed() {
|
||||
-#if !BUILDFLAG(IS_ANDROID) // Android does not implement this function.
|
||||
+#if 0 // Electron does not implement this function.
|
||||
+#if 0 // Electron does not use Chromium error dialogs
|
||||
if (!canceling_job_)
|
||||
ShowPrintErrorDialog();
|
||||
#endif
|
||||
@@ -800,7 +846,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
|
||||
ShowPrintErrorDialogForGenericError();
|
||||
-
|
||||
+#endif
|
||||
TerminatePrintJob(true);
|
||||
}
|
||||
|
||||
@@ -808,7 +861,7 @@ bool PrintViewManagerBase::RenderAllMissingPagesNow() {
|
||||
|
||||
// Is the document already complete?
|
||||
if (print_job_->document() && print_job_->document()->IsComplete()) {
|
||||
|
@ -354,7 +348,7 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
return true;
|
||||
}
|
||||
|
||||
@@ -848,7 +894,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
@@ -856,7 +909,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
|
||||
// Disconnect the current `print_job_`.
|
||||
auto weak_this = weak_ptr_factory_.GetWeakPtr();
|
||||
|
@ -366,7 +360,7 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
if (!weak_this)
|
||||
return false;
|
||||
|
||||
@@ -869,7 +918,7 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
@@ -877,7 +933,7 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
#endif
|
||||
print_job_->AddObserver(*this);
|
||||
|
||||
|
@ -375,7 +369,7 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
return true;
|
||||
}
|
||||
|
||||
@@ -931,6 +980,11 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
@@ -939,6 +995,11 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -387,7 +381,7 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
if (!print_job_)
|
||||
return;
|
||||
|
||||
@@ -938,7 +992,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
@@ -946,7 +1007,7 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
// printing_rfh_ should only ever point to a RenderFrameHost with a live
|
||||
// RenderFrame.
|
||||
DCHECK(rfh->IsRenderFrameLive());
|
||||
|
@ -396,7 +390,7 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
}
|
||||
|
||||
print_job_->RemoveObserver(*this);
|
||||
@@ -980,7 +1034,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||
@@ -988,7 +1049,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||
}
|
||||
|
||||
bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
|
||||
|
@ -405,7 +399,7 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
return true;
|
||||
|
||||
if (!cookie) {
|
||||
@@ -1086,7 +1140,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() {
|
||||
@@ -1105,7 +1166,7 @@ void PrintViewManagerBase::ReleasePrinterQuery() {
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::CompletePrintNow(content::RenderFrameHost* rfh) {
|
||||
|
@ -415,7 +409,7 @@ index 34d6001efd674bd49031845e8257c468d894258e..4f29c2ac96e50cdfe49669802edfd9ab
|
|||
for (auto& observer : GetObservers())
|
||||
observer.OnPrintNow(rfh);
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
|
||||
index 1fe06e1ffd9ad45afe01fe0d4282a38759a53f3a..998bebb10e9fa24414e1adeb626c93dec46f7812 100644
|
||||
index e81de668ec6e4c3b357aced73106effdcb04aafe..fefb49202dd5b66f8cdc799e9ee0b23f11a49303 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.h
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.h
|
||||
@@ -46,6 +46,8 @@ namespace printing {
|
||||
|
@ -427,7 +421,7 @@ index 1fe06e1ffd9ad45afe01fe0d4282a38759a53f3a..998bebb10e9fa24414e1adeb626c93de
|
|||
// Base class for managing the print commands for a WebContents.
|
||||
class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
|
||||
public:
|
||||
@@ -71,7 +73,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
|
||||
@@ -74,7 +76,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
|
||||
// Prints the current document immediately. Since the rendering is
|
||||
// asynchronous, the actual printing will not be completed on the return of
|
||||
// this function. Returns false if printing is impossible at the moment.
|
||||
|
@ -439,15 +433,18 @@ index 1fe06e1ffd9ad45afe01fe0d4282a38759a53f3a..998bebb10e9fa24414e1adeb626c93de
|
|||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
// Prints the document in `print_data` with settings specified in
|
||||
@@ -127,6 +132,7 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
|
||||
void ShowInvalidPrinterSettingsError() override;
|
||||
@@ -127,8 +132,10 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
|
||||
void IsPrintingEnabled(IsPrintingEnabledCallback callback) override;
|
||||
void ScriptedPrint(mojom::ScriptedPrintParamsPtr params,
|
||||
ScriptedPrintCallback callback) override;
|
||||
+ void ShowInvalidPrinterSettingsError() override;
|
||||
void PrintingFailed(int32_t cookie,
|
||||
mojom::PrintFailureReason reason) override;
|
||||
+ void UserInitCanceled();
|
||||
|
||||
// Adds and removes observers for `PrintViewManagerBase` events. The order in
|
||||
// which notifications are sent to observers is undefined. Observers must be
|
||||
@@ -134,6 +140,14 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
|
||||
@@ -136,6 +143,14 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
|
||||
void AddObserver(Observer& observer);
|
||||
void RemoveObserver(Observer& observer);
|
||||
|
||||
|
@ -462,7 +459,7 @@ index 1fe06e1ffd9ad45afe01fe0d4282a38759a53f3a..998bebb10e9fa24414e1adeb626c93de
|
|||
protected:
|
||||
explicit PrintViewManagerBase(content::WebContents* web_contents);
|
||||
|
||||
@@ -270,7 +284,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
|
||||
@@ -273,7 +288,8 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
|
||||
// Runs `callback` with `params` to reply to ScriptedPrint().
|
||||
void ScriptedPrintReply(ScriptedPrintCallback callback,
|
||||
int process_id,
|
||||
|
@ -472,7 +469,7 @@ index 1fe06e1ffd9ad45afe01fe0d4282a38759a53f3a..998bebb10e9fa24414e1adeb626c93de
|
|||
|
||||
// Requests the RenderView to render all the missing pages for the print job.
|
||||
// No-op if no print job is pending. Returns true if at least one page has
|
||||
@@ -340,8 +355,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
|
||||
@@ -343,8 +359,11 @@ class PrintViewManagerBase : public PrintManager, public PrintJob::Observer {
|
||||
// The current RFH that is printing with a system printing dialog.
|
||||
raw_ptr<content::RenderFrameHost> printing_rfh_ = nullptr;
|
||||
|
||||
|
@ -539,11 +536,36 @@ index 7f6faeb58f91bbcb8f836ad3a7c7e9007558e480..9ee41950cd4ec67df73ee73ecdeaae10
|
|||
void PrintWithParams(mojom::PrintPagesParamsPtr params,
|
||||
PrintWithParamsCallback callback) override;
|
||||
void PrintForSystemDialog() override;
|
||||
diff --git a/components/printing/browser/print_manager.cc b/components/printing/browser/print_manager.cc
|
||||
index 21c81377d32ae8d4185598a7eba88ed1d2063ef0..0767f4e9369e926b1cea99178c1a1975941f1765 100644
|
||||
--- a/components/printing/browser/print_manager.cc
|
||||
+++ b/components/printing/browser/print_manager.cc
|
||||
@@ -47,6 +47,8 @@ void PrintManager::IsPrintingEnabled(IsPrintingEnabledCallback callback) {
|
||||
std::move(callback).Run(true);
|
||||
}
|
||||
|
||||
+void PrintManager::ShowInvalidPrinterSettingsError() {}
|
||||
+
|
||||
void PrintManager::PrintingFailed(int32_t cookie,
|
||||
mojom::PrintFailureReason reason) {
|
||||
// Note: Not redundant with cookie checks in the same method in other parts of
|
||||
diff --git a/components/printing/browser/print_manager.h b/components/printing/browser/print_manager.h
|
||||
index ca71560874a0189068dd11fbc039f5673bf6bd96..a8551d95e64da2afbc1685b2df8f1fc377c7117b 100644
|
||||
--- a/components/printing/browser/print_manager.h
|
||||
+++ b/components/printing/browser/print_manager.h
|
||||
@@ -48,6 +48,7 @@ class PrintManager : public content::WebContentsObserver,
|
||||
DidPrintDocumentCallback callback) override;
|
||||
void IsPrintingEnabled(IsPrintingEnabledCallback callback) override;
|
||||
void DidShowPrintDialog() override;
|
||||
+ void ShowInvalidPrinterSettingsError() override;
|
||||
void PrintingFailed(int32_t cookie,
|
||||
mojom::PrintFailureReason reason) override;
|
||||
|
||||
diff --git a/components/printing/common/print.mojom b/components/printing/common/print.mojom
|
||||
index 42d9af1e278f6c3e09bb7e54a7c4de0f17d064bf..96112222530e63f911d866884eca03cce24c3ade 100644
|
||||
index d18160466a3d4ada8fd6c1bfbb0ee674785a3b6e..69703fe649226f3d335059bfd6c9713f259413f2 100644
|
||||
--- a/components/printing/common/print.mojom
|
||||
+++ b/components/printing/common/print.mojom
|
||||
@@ -289,7 +289,7 @@ union PrintWithParamsResult {
|
||||
@@ -291,7 +291,7 @@ union PrintWithParamsResult {
|
||||
interface PrintRenderFrame {
|
||||
// Tells the RenderFrame to switch the CSS to print media type, render every
|
||||
// requested page, and then switch back the CSS to display media type.
|
||||
|
@ -552,20 +574,23 @@ index 42d9af1e278f6c3e09bb7e54a7c4de0f17d064bf..96112222530e63f911d866884eca03cc
|
|||
|
||||
// Requests the frame to be printed with specified parameters. This is used
|
||||
// to programmatically produce PDF by request from the browser (e.g. over
|
||||
@@ -380,7 +380,7 @@ interface PrintManagerHost {
|
||||
@@ -382,7 +382,10 @@ interface PrintManagerHost {
|
||||
// Requests the print settings from the user. This step is about showing
|
||||
// UI to the user to select the final print settings.
|
||||
[Sync]
|
||||
- ScriptedPrint(ScriptedPrintParams params) => (PrintPagesParams settings);
|
||||
+ ScriptedPrint(ScriptedPrintParams params) => (PrintPagesParams settings, bool canceled);
|
||||
+
|
||||
+ // Tells the browser that there are invalid printer settings.
|
||||
+ ShowInvalidPrinterSettingsError();
|
||||
|
||||
// Tells the browser that there are invalid printer settings.
|
||||
ShowInvalidPrinterSettingsError();
|
||||
// Tells the browser printing failed.
|
||||
PrintingFailed(int32 cookie, PrintFailureReason reason);
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
|
||||
index f97675b7abe9553a4ea11ba7faa91f042e133448..0b269b93206c07befdb12d0a0e7f796605026976 100644
|
||||
index 23e925a62ed40710537e2e1b51100ee084f60ecd..8bd962c01ffd9c04facb5cac8795c506f618de6d 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -43,6 +43,7 @@
|
||||
@@ -45,6 +45,7 @@
|
||||
#include "printing/mojom/print.mojom.h"
|
||||
#include "printing/page_number.h"
|
||||
#include "printing/print_job_constants.h"
|
||||
|
@ -573,7 +598,7 @@ index f97675b7abe9553a4ea11ba7faa91f042e133448..0b269b93206c07befdb12d0a0e7f7966
|
|||
#include "printing/units.h"
|
||||
#include "services/metrics/public/cpp/ukm_source_id.h"
|
||||
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
|
||||
@@ -1316,7 +1317,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
@@ -1335,7 +1336,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
if (!weak_this)
|
||||
return;
|
||||
|
||||
|
@ -583,7 +608,7 @@ index f97675b7abe9553a4ea11ba7faa91f042e133448..0b269b93206c07befdb12d0a0e7f7966
|
|||
if (!weak_this)
|
||||
return;
|
||||
|
||||
@@ -1347,7 +1349,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
|
||||
@@ -1366,7 +1368,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
|
||||
receivers_.Add(this, std::move(receiver));
|
||||
}
|
||||
|
||||
|
@ -592,7 +617,7 @@ index f97675b7abe9553a4ea11ba7faa91f042e133448..0b269b93206c07befdb12d0a0e7f7966
|
|||
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
|
||||
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
|
||||
return;
|
||||
@@ -1362,7 +1364,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
|
||||
@@ -1381,7 +1383,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
|
||||
// plugin node and print that instead.
|
||||
auto plugin = delegate_->GetPdfElement(frame);
|
||||
|
||||
|
@ -601,7 +626,7 @@ index f97675b7abe9553a4ea11ba7faa91f042e133448..0b269b93206c07befdb12d0a0e7f7966
|
|||
|
||||
if (!render_frame_gone_)
|
||||
frame->DispatchAfterPrintEvent();
|
||||
@@ -1444,7 +1446,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
|
||||
@@ -1463,7 +1465,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
|
||||
}
|
||||
|
||||
Print(frame, print_preview_context_.source_node(),
|
||||
|
@ -611,7 +636,7 @@ index f97675b7abe9553a4ea11ba7faa91f042e133448..0b269b93206c07befdb12d0a0e7f7966
|
|||
if (!render_frame_gone_)
|
||||
print_preview_context_.DispatchAfterPrintEvent();
|
||||
// WARNING: |this| may be gone at this point. Do not do any more work here and
|
||||
@@ -1493,6 +1496,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
|
||||
@@ -1512,6 +1515,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value::Dict settings) {
|
||||
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
|
||||
return;
|
||||
|
||||
|
@ -620,7 +645,7 @@ index f97675b7abe9553a4ea11ba7faa91f042e133448..0b269b93206c07befdb12d0a0e7f7966
|
|||
print_preview_context_.OnPrintPreview();
|
||||
|
||||
#if BUILDFLAG(IS_CHROMEOS_ASH)
|
||||
@@ -2103,7 +2108,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -2122,7 +2127,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
return;
|
||||
|
||||
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
|
||||
|
@ -630,7 +655,7 @@ index f97675b7abe9553a4ea11ba7faa91f042e133448..0b269b93206c07befdb12d0a0e7f7966
|
|||
// Check if |this| is still valid.
|
||||
if (!weak_this)
|
||||
return;
|
||||
@@ -2118,7 +2124,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -2137,7 +2143,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
|
@ -641,7 +666,7 @@ index f97675b7abe9553a4ea11ba7faa91f042e133448..0b269b93206c07befdb12d0a0e7f7966
|
|||
// If still not finished with earlier print request simply ignore.
|
||||
if (prep_frame_view_)
|
||||
return;
|
||||
@@ -2126,7 +2134,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -2145,7 +2153,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
FrameReference frame_ref(frame);
|
||||
|
||||
uint32_t expected_page_count = 0;
|
||||
|
@ -650,7 +675,7 @@ index f97675b7abe9553a4ea11ba7faa91f042e133448..0b269b93206c07befdb12d0a0e7f7966
|
|||
DidFinishPrinting(FAIL_PRINT_INIT);
|
||||
return; // Failed to init print page settings.
|
||||
}
|
||||
@@ -2145,8 +2153,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -2164,8 +2172,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
print_pages_params_->params->print_scaling_option;
|
||||
|
||||
auto self = weak_ptr_factory_.GetWeakPtr();
|
||||
|
@ -667,7 +692,7 @@ index f97675b7abe9553a4ea11ba7faa91f042e133448..0b269b93206c07befdb12d0a0e7f7966
|
|||
// Check if |this| is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -2408,36 +2423,52 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
@@ -2421,36 +2436,53 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -697,10 +722,8 @@ index f97675b7abe9553a4ea11ba7faa91f042e133448..0b269b93206c07befdb12d0a0e7f7966
|
|||
// Check if the printer returned any settings, if the settings is empty, we
|
||||
// can safely assume there are no printer drivers configured. So we safely
|
||||
// terminate.
|
||||
bool result = true;
|
||||
- if (!PrintMsgPrintParamsIsValid(*settings.params))
|
||||
+ if (!PrintMsgPrintParamsIsValid(*settings->params))
|
||||
result = false;
|
||||
- const bool result = PrintMsgPrintParamsIsValid(*settings.params);
|
||||
+ const bool result = PrintMsgPrintParamsIsValid(*settings->params);
|
||||
|
||||
// Reset to default values.
|
||||
ignore_css_margins_ = false;
|
||||
|
@ -729,10 +752,13 @@ index f97675b7abe9553a4ea11ba7faa91f042e133448..0b269b93206c07befdb12d0a0e7f7966
|
|||
bool fit_to_paper_size = !IsPrintingPdfFrame(frame, node);
|
||||
- if (!InitPrintSettings(fit_to_paper_size)) {
|
||||
+ if (!InitPrintSettings(fit_to_paper_size, std::move(settings))) {
|
||||
// Browser triggered this code path. It already knows about the failure.
|
||||
notify_browser_of_print_failure_ = false;
|
||||
GetPrintManagerHost()->ShowInvalidPrinterSettingsError();
|
||||
+ GetPrintManagerHost()->ShowInvalidPrinterSettingsError();
|
||||
return false;
|
||||
@@ -2564,7 +2595,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser(
|
||||
}
|
||||
|
||||
@@ -2575,7 +2607,7 @@ mojom::PrintPagesParamsPtr PrintRenderFrameHelper::GetPrintSettingsFromUser(
|
||||
std::move(params),
|
||||
base::BindOnce(
|
||||
[](base::OnceClosure quit_closure, mojom::PrintPagesParamsPtr* output,
|
||||
|
@ -742,7 +768,7 @@ index f97675b7abe9553a4ea11ba7faa91f042e133448..0b269b93206c07befdb12d0a0e7f7966
|
|||
std::move(quit_closure).Run();
|
||||
},
|
||||
diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h
|
||||
index 3f82c0cdfd11a8d0c3cbcba9cc74b0e3e1a41b0f..36c1df7e3346f51945721ababf12dc3424f17686 100644
|
||||
index c7be37dc31f4725c945e7fde016b542d6e2b5902..03eff9ffcec9c655542d9c6508d9eb2fcad95583 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.h
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.h
|
||||
@@ -253,7 +253,7 @@ class PrintRenderFrameHelper
|
||||
|
@ -754,7 +780,7 @@ index 3f82c0cdfd11a8d0c3cbcba9cc74b0e3e1a41b0f..36c1df7e3346f51945721ababf12dc34
|
|||
void PrintWithParams(mojom::PrintPagesParamsPtr params,
|
||||
PrintWithParamsCallback callback) override;
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
@@ -326,7 +326,9 @@ class PrintRenderFrameHelper
|
||||
@@ -328,7 +328,9 @@ class PrintRenderFrameHelper
|
||||
// WARNING: |this| may be gone after this method returns.
|
||||
void Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
|
@ -765,7 +791,7 @@ index 3f82c0cdfd11a8d0c3cbcba9cc74b0e3e1a41b0f..36c1df7e3346f51945721ababf12dc34
|
|||
|
||||
// Notification when printing is done - signal tear-down/free resources.
|
||||
void DidFinishPrinting(PrintingResult result);
|
||||
@@ -335,12 +337,14 @@ class PrintRenderFrameHelper
|
||||
@@ -337,12 +339,14 @@ class PrintRenderFrameHelper
|
||||
|
||||
// Initialize print page settings with default settings.
|
||||
// Used only for native printing workflow.
|
||||
|
@ -783,10 +809,10 @@ index 3f82c0cdfd11a8d0c3cbcba9cc74b0e3e1a41b0f..36c1df7e3346f51945721ababf12dc34
|
|||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
// Set options for print preset from source PDF document.
|
||||
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
|
||||
index f8325e930179fcb7a675db696fbfe0e2436b769b..9ba992e9ce8e107949db8dfc928a478b50fea35a 100644
|
||||
index 2faf1f903d034bd21367eccd6e56e0eb032104be..5648b47389a22845d37f4bdbc2287aadc4ecfed7 100644
|
||||
--- a/content/browser/BUILD.gn
|
||||
+++ b/content/browser/BUILD.gn
|
||||
@@ -2827,8 +2827,9 @@ source_set("browser") {
|
||||
@@ -2816,8 +2816,9 @@ source_set("browser") {
|
||||
"//ppapi/shared_impl",
|
||||
]
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue