chore: bump chromium to 6b9fa6b352d824d052222e1abe541 (master) (#25558)

* chore: bump chromium in DEPS to d5c9bf9e2a18fa508201a88e5803bec1d107b1ae

* chore: bump chromium in DEPS to 45f1316afae33e52c92480b34bf4f7fe4a7db898

* update patches

* WillCreateURLLoaderFactory now gets a ukm_source_id

Refs: 2346803

* ink_drop_visible_opacity -> GetInkDropVisibleOpacity

Refs: 2415368

* chore: bump chromium in DEPS to ddb5b6db5e35ab1a7b5adbd9f15373af6c35ea2a

* 2418471: PDF Viewer update: Add missing aria-labels to various buttons.

2418471

* update printing.patch given print settings mojoification

Refs: 2409467

* update patches

* content::BluetoothChooser::Event -> content::BluetoothChooserEvent

Refs: 2387901

* set_ink_drop_base_color -> SetInkDropBaseColor

Refs: 2419388

* chore: bump chromium in DEPS to ecf7c9ee830d4d85f300b461a2fa13aa40c79a4c

* update patches

* gfx::ConvertPointToPixel -> gfx::ConvertPointToPixels

Refs: 2418568

* remove ContentSettingsObserver::AllowStorage()

Refs: 2401847

* service_manager::kCrashDumpSignal -> kCrashDumpSignal

Refs: 2417073

* chore: bump chromium in DEPS to abdb7ebe5f8c8328b8f435283df90d0a3ecff7bd

* chore: bump chromium in DEPS to 2a7e138ab1066534ceb2622e8a9d2c8ebf574215

* chore: bump chromium in DEPS to ab1884e75ced904e4276851eb4e1ad89919ca93b

* chore: bump chromium in DEPS to a12413902380dcc2a73ac74d582328280a8af686

* Fixup printing patch

2428623

* Fixup OSR patch

2415128

* Make ExtensionURLLoaderFactory always owned by its |receivers_|.

2357523

* Add deprecated_default_sources_assignment_filter variable

2416496

* Fixup patch indices

* Remove several references to BrowserPlugin from content

2401031

* Remove SurfaceEmbeddingTime and LocalSurfaceIdAllocation

2415128

* Add DragOperation and AllowedDragOperations Mojo types

2196167

* chore: bump chromium in DEPS to 378450342cf6aa160663d0ce3a178a11b570c25a

* Fixup patch indices

* Remove SurfaceEmbeddingTime and LocalSurfaceIdAllocation

2415128

* Add DragOperation and AllowedDragOperations Mojo types

2196167

* 2426564: Remove global sources assignment filter value

2426564

* Fixup blink_local_frame.patch

* [XProto] Remove a subset of ui/gfx/x/x11.h

2430328

* Fixup patch indices

* Remove several references to BrowserPlugin from content

2401031

* Remove lossy ConvertSizeToPixel() methods

2419534

* serial: Use USB driver name to disambiguate ports

2413176

* Remove set_sources_filter import

* Fix ModMask usage

* [XProto] Remove usage of all Xlib headers

2392140

* [XProto] Remove usage of Xlib Visuals

2429933

* Skip Angle manifest file

2425197

* Add whole src\third_party\angle\.git directory

This directory is needed in order to properly generate gen/angle/angle_commit.h

* [libvpx] Fix HighBD config on Windows ARM64

2437745

* update patches

* fix: correct calling convention for Windows on Arm

2440717

* Add third_party/angle/.git to the archive before adding the rest of the source

* fixup source caching on Windows

* Fixup erroneous close paren

* fixup for goma issues

* This should work

* chore: bump chromium roll manually

2435142

This landed the day after we paused roller-bot and may resolve the
visibility test flakes that we're seeing. h/t to @jkleinsc for
finding this with me.

* chore: remove obsoleted cherry-pick fix for libvpx

2437745

* chore: remove obsoleted cherry-pick libvpx patch

2437745

* chore: re-export patches

* chore: add tracer comment to visibility-stat-spec.

The line numbers between the source and the CI runs don't seem to match
up, so this temp tracer is to help track the source of that difference.

* chore: bump chromium in DEPS to 7c2b8cc3b8638aee8abeb013042a6c1d15b2da6b

* update patches

* impl SortingLSH service

Refs: 2425327

* 2446525: [Flash] Remove some Flash APIs

2446525

* 2440974: Reland "Delete service_manager/embedder/switches.h"

2440974

* 2359402: Remove ContentBrowserClient::NonNetworkURLLoaderFactoryDeprecatedMap.

2359402

* 2250506: Implement tabs.removeCSS

2250506

* 2429143: Remove implicit-conversion-to-integer ConvertRectToPixel() methods.

2429143

* 2444430: Remove DataElementType::kBlob

2444430

* 2441964: Clean up WebView public API

2441964

* 2357523: Make ExtensionURLLoaderFactory always owned by its |receivers_|.

2357523

* 2461606: Use blink::mojom::PreferredColorScheme instead of blink::PreferredColorScheme

2461606

* 2461235: a11y inspect reorg: move PropertyFilter struct to a new location

2461235

* remove flash support

* fix frame_host_manager patch

* fix lint

* remove flash info from docs

* fix build

* fix osr

* chore: bump chromium in DEPS to 9269f9eb1d98d29564c2b2ab97f30c6e148c4e11

* fix visibilityState tests

* 2463049: Replace all uses of web_pref::AutoplayPolicy with mojom::AutoplayPolicy

2463049

* update patches

* fix tests harder

* 2414921: Add Group and Ungroup functions to Tabs extension API

2414921

* more test fix

* Remove all keyboard related usage of Xlib

Refs: 2436787

* fix linux build

* 2453807: [XProto] Remove usage of Xlib error handling

2453807

* lint

* fixup! 2453807: [XProto] Remove usage of Xlib error handling

* disable CalculateNativeWinOcclusion on win ci

* remove UploadBlob from docs

* Update appveyor.yml

Co-authored-by: Andy Locascio <andy@slack-corp.com>
Co-authored-by: John Kleinschmidt <jkleinsc@github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Jeremy Rose <nornagon@nornagon.net>
Co-authored-by: Electron Bot <anonymous@electronjs.org>
Co-authored-by: Charles Kerr <charles@charleskerr.com>
Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
Co-authored-by: Jeremy Rose <jeremya@chromium.org>
This commit is contained in:
Electron Bot 2020-10-15 18:30:41 -07:00 committed by GitHub
parent 20c6677a9c
commit 46f3491c7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
135 changed files with 1087 additions and 1609 deletions

View file

@ -43,7 +43,7 @@ index 4f3b68135f9bb29f2c36055f50e1725a9b36a856..c788d412544fdcc89925127844497526
using RenderMode = PdfRenderSettings::Mode;
RenderMode mode;
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
index 49894fbab5d7cd265cce27e49debf747c188bbd3..db4923ce99f3c78bc15bed7cfdf9a71adb516adf 100644
index 89c7798d8ddf21eb74e726c142377afa05b59c26..dd75b8e82552a54868ce86caf90ba175af64e937 100644
--- a/chrome/browser/printing/print_job_worker.cc
+++ b/chrome/browser/printing/print_job_worker.cc
@@ -21,7 +21,6 @@
@ -102,7 +102,7 @@ index 49894fbab5d7cd265cce27e49debf747c188bbd3..db4923ce99f3c78bc15bed7cfdf9a71a
}
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
index fb2a4c003b1d71e321c69faadbef64b8e6f8adb4..8f5d4647f8c0417d03a8f15ef5945512b4acca96 100644
index ad70dada204132ce44d6613378072a080771148a..02ecf3e77bee365eef4dc8a985cfe092785b8b8e 100644
--- a/chrome/browser/printing/print_view_manager_base.cc
+++ b/chrome/browser/printing/print_view_manager_base.cc
@@ -28,10 +28,7 @@
@ -124,7 +124,7 @@ index fb2a4c003b1d71e321c69faadbef64b8e6f8adb4..8f5d4647f8c0417d03a8f15ef5945512
#include "mojo/public/cpp/system/buffer.h"
#include "printing/buildflags/buildflags.h"
#include "printing/metafile_skia.h"
@@ -71,6 +69,8 @@ using PrintSettingsCallback =
@@ -72,6 +70,8 @@ using PrintSettingsCallback =
base::OnceCallback<void(std::unique_ptr<PrinterQuery>)>;
void ShowWarningMessageBox(const base::string16& message) {
@ -133,7 +133,7 @@ index fb2a4c003b1d71e321c69faadbef64b8e6f8adb4..8f5d4647f8c0417d03a8f15ef5945512
// Runs always on the UI thread.
static bool is_dialog_shown = false;
if (is_dialog_shown)
@@ -79,6 +79,7 @@ void ShowWarningMessageBox(const base::string16& message) {
@@ -80,6 +80,7 @@ void ShowWarningMessageBox(const base::string16& message) {
base::AutoReset<bool> auto_reset(&is_dialog_shown, true);
chrome::ShowWarningMessageBox(nullptr, base::string16(), message);
@ -141,7 +141,7 @@ index fb2a4c003b1d71e321c69faadbef64b8e6f8adb4..8f5d4647f8c0417d03a8f15ef5945512
}
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
@@ -115,12 +116,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
@@ -172,12 +173,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
: PrintManager(web_contents),
queue_(g_browser_process->print_job_manager()->queue()) {
DCHECK(queue_);
@ -156,7 +156,7 @@ index fb2a4c003b1d71e321c69faadbef64b8e6f8adb4..8f5d4647f8c0417d03a8f15ef5945512
}
PrintViewManagerBase::~PrintViewManagerBase() {
@@ -128,7 +131,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
@@ -185,7 +188,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
DisconnectFromCurrentPrintJob();
}
@ -168,7 +168,7 @@ index fb2a4c003b1d71e321c69faadbef64b8e6f8adb4..8f5d4647f8c0417d03a8f15ef5945512
DisconnectFromCurrentPrintJob();
// Don't print / print preview crashed tabs.
@@ -136,7 +142,14 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
@@ -193,7 +199,14 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
return false;
SetPrintingRFH(rfh);
@ -184,7 +184,7 @@ index fb2a4c003b1d71e321c69faadbef64b8e6f8adb4..8f5d4647f8c0417d03a8f15ef5945512
return true;
}
@@ -257,9 +270,9 @@ void PrintViewManagerBase::StartLocalPrintJob(
@@ -314,9 +327,9 @@ void PrintViewManagerBase::StartLocalPrintJob(
void PrintViewManagerBase::UpdatePrintingEnabled() {
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
// The Unretained() is safe because ForEachFrame() is synchronous.
@ -197,7 +197,7 @@ index fb2a4c003b1d71e321c69faadbef64b8e6f8adb4..8f5d4647f8c0417d03a8f15ef5945512
}
void PrintViewManagerBase::NavigationStopped() {
@@ -371,7 +384,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) {
@@ -441,7 +454,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) {
PrintManager::PrintingFailed(cookie);
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
@ -206,7 +206,7 @@ index fb2a4c003b1d71e321c69faadbef64b8e6f8adb4..8f5d4647f8c0417d03a8f15ef5945512
#endif
ReleasePrinterQuery();
@@ -390,6 +403,11 @@ void PrintViewManagerBase::OnScriptedPrint(
@@ -460,6 +473,11 @@ void PrintViewManagerBase::OnScriptedPrint(
}
void PrintViewManagerBase::ShowInvalidPrinterSettingsError() {
@ -218,7 +218,7 @@ index fb2a4c003b1d71e321c69faadbef64b8e6f8adb4..8f5d4647f8c0417d03a8f15ef5945512
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE, base::BindOnce(&ShowWarningMessageBox,
l10n_util::GetStringUTF16(
@@ -459,9 +477,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
@@ -529,9 +547,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
content::NotificationService::NoDetails());
break;
}
@ -234,7 +234,7 @@ index fb2a4c003b1d71e321c69faadbef64b8e6f8adb4..8f5d4647f8c0417d03a8f15ef5945512
NOTREACHED();
break;
}
@@ -557,8 +579,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
@@ -627,8 +649,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
DCHECK(!quit_inner_loop_);
DCHECK(query);
@ -247,7 +247,7 @@ index fb2a4c003b1d71e321c69faadbef64b8e6f8adb4..8f5d4647f8c0417d03a8f15ef5945512
// We can't print if there is no renderer.
if (!web_contents()->GetRenderViewHost() ||
@@ -579,8 +603,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
@@ -649,8 +673,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
print_job_->SetSource(source, /*source_id=*/"");
#endif
@ -256,7 +256,7 @@ index fb2a4c003b1d71e321c69faadbef64b8e6f8adb4..8f5d4647f8c0417d03a8f15ef5945512
printing_succeeded_ = false;
return true;
}
@@ -629,14 +651,22 @@ void PrintViewManagerBase::ReleasePrintJob() {
@@ -699,14 +721,22 @@ void PrintViewManagerBase::ReleasePrintJob() {
content::RenderFrameHost* rfh = printing_rfh_;
printing_rfh_ = nullptr;
@ -281,7 +281,7 @@ index fb2a4c003b1d71e321c69faadbef64b8e6f8adb4..8f5d4647f8c0417d03a8f15ef5945512
// Don't close the worker thread.
print_job_ = nullptr;
}
@@ -672,7 +702,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
@@ -742,7 +772,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
}
bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
@ -291,7 +291,7 @@ index fb2a4c003b1d71e321c69faadbef64b8e6f8adb4..8f5d4647f8c0417d03a8f15ef5945512
if (!cookie) {
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
index 32832869dc4f578442329a2ed9ce6a4cd4bb4dc9..f168bb2e732fb3ced929655a47a32ab04820edaa 100644
index 1498facaafeacebeb38b96ff46c0f48c5a650ad0..095d9dfcc3ee14b646b63c29e406434c1623704a 100644
--- a/chrome/browser/printing/print_view_manager_base.h
+++ b/chrome/browser/printing/print_view_manager_base.h
@@ -38,6 +38,8 @@ class PrintJob;
@ -332,7 +332,7 @@ index 32832869dc4f578442329a2ed9ce6a4cd4bb4dc9..f168bb2e732fb3ced929655a47a32ab0
// This means we are _blocking_ until all the necessary pages have been
// rendered or the print settings are being loaded.
diff --git a/chrome/browser/printing/printing_message_filter.cc b/chrome/browser/printing/printing_message_filter.cc
index 0a8ead2ee790ed549136d6bb7e81c0d77e3e5ac2..06b5561f386efbeaa7474c3ccb2218d8694d0c9b 100644
index 90996efd58d5428e511bf0e656b64871aebe66e9..4f6e07c5eeb215d7bb8577ff39a07b1a6d808615 100644
--- a/chrome/browser/printing/printing_message_filter.cc
+++ b/chrome/browser/printing/printing_message_filter.cc
@@ -22,6 +22,7 @@
@ -369,21 +369,7 @@ index 0a8ead2ee790ed549136d6bb7e81c0d77e3e5ac2..06b5561f386efbeaa7474c3ccb2218d8
}
PrintingMessageFilter::~PrintingMessageFilter() {
@@ -138,11 +142,13 @@ bool PrintingMessageFilter::OnMessageReceived(const IPC::Message& message) {
void PrintingMessageFilter::OnGetDefaultPrintSettings(IPC::Message* reply_msg) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
+#if 0
if (!is_printing_enabled_.GetValue()) {
// Reply with null query.
OnGetDefaultPrintSettingsReply(nullptr, reply_msg);
return;
}
+#endif
std::unique_ptr<PrinterQuery> printer_query = queue_->PopPrinterQuery(0);
if (!printer_query) {
printer_query =
@@ -226,12 +232,13 @@ void PrintingMessageFilter::OnScriptedPrintReply(
@@ -180,12 +184,13 @@ void PrintingMessageFilter::OnScriptedPrintReply(
void PrintingMessageFilter::OnUpdatePrintSettings(int document_cookie,
base::Value job_settings,
IPC::Message* reply_msg) {
@ -398,7 +384,7 @@ index 0a8ead2ee790ed549136d6bb7e81c0d77e3e5ac2..06b5561f386efbeaa7474c3ccb2218d8
if (!job_settings.is_dict() ||
!job_settings.FindIntKey(kSettingPrinterType)) {
// Reply with null query.
@@ -265,7 +272,9 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
@@ -219,7 +224,9 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
IPC::Message* reply_msg) {
mojom::PrintPagesParams params;
params.params = mojom::PrintParams::New();
@ -409,7 +395,7 @@ index 0a8ead2ee790ed549136d6bb7e81c0d77e3e5ac2..06b5561f386efbeaa7474c3ccb2218d8
RenderParamsFromPrintSettings(printer_query->settings(),
params.params.get());
params.params->document_cookie = printer_query->cookie();
@@ -302,7 +311,7 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
@@ -256,7 +263,7 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
void PrintingMessageFilter::OnCheckForCancel(const mojom::PreviewIds& ids,
bool* cancel) {
@ -419,7 +405,7 @@ index 0a8ead2ee790ed549136d6bb7e81c0d77e3e5ac2..06b5561f386efbeaa7474c3ccb2218d8
#endif
diff --git a/chrome/browser/printing/printing_message_filter.h b/chrome/browser/printing/printing_message_filter.h
index 1431e6c24b325bc32dd66f35895fdbd9a08f8eb6..13c4d30a2ac1bd2b1b589bddae49274ab4eef61e 100644
index 87b1cd59ed79d6b81860fd2deb415020450523c1..a0bd1370a637168a4159c1b24f412dd3507f1ea2 100644
--- a/chrome/browser/printing/printing_message_filter.h
+++ b/chrome/browser/printing/printing_message_filter.h
@@ -22,6 +22,10 @@
@ -444,7 +430,7 @@ index 1431e6c24b325bc32dd66f35895fdbd9a08f8eb6..13c4d30a2ac1bd2b1b589bddae49274a
// content::BrowserMessageFilter:
bool OnMessageReceived(const IPC::Message& message) override;
diff --git a/components/printing/common/print.mojom b/components/printing/common/print.mojom
index 3a8f9c3c3c14d1ed8f2047ab7d9aafb34f74bb55..e70ee384970ce4731ba59a835fc502fdd8e89cd4 100644
index 4b140a2a0f431cd7b06a8d1b6f9e84981f4ce7e7..14779debdacc7b5f78aa0799f197241dba914aff 100644
--- a/components/printing/common/print.mojom
+++ b/components/printing/common/print.mojom
@@ -230,7 +230,7 @@ interface PrintPreviewUI {
@ -457,7 +443,7 @@ index 3a8f9c3c3c14d1ed8f2047ab7d9aafb34f74bb55..e70ee384970ce4731ba59a835fc502fd
// Tells the RenderFrame to switch the CSS to print media type, render every
// requested page using the print preview document's frame/node, and then
diff --git a/components/printing/renderer/print_render_frame_helper.cc b/components/printing/renderer/print_render_frame_helper.cc
index ab63f19db624b62a4be7539831f371c8a0c7dcfa..780c090157b179d9bf8a33bbbb7b14f702e854c3 100644
index 58e8aa32aa5f291b000753dc4487835a53df34c5..b5529c8b2697af7e94311707a5d14f9cedab434c 100644
--- a/components/printing/renderer/print_render_frame_helper.cc
+++ b/components/printing/renderer/print_render_frame_helper.cc
@@ -38,6 +38,7 @@
@ -468,15 +454,17 @@ index ab63f19db624b62a4be7539831f371c8a0c7dcfa..780c090157b179d9bf8a33bbbb7b14f7
#include "printing/units.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_provider.h"
#include "third_party/blink/public/common/associated_interfaces/associated_interface_registry.h"
@@ -1169,6 +1170,7 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
// Pause between onbeforeprint and onafterprint events.
// https://html.spec.whatwg.org/C/#printing-steps
Print(web_frame, blink::WebNode(), PrintRequestType::kScripted,
+ false /* silent */, base::DictionaryValue() /* new_settings */,
blink::WebScopedPagePauser::Create());
@@ -1143,7 +1144,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
if (!weak_this)
return;
- Print(web_frame, blink::WebNode(), PrintRequestType::kScripted);
+ Print(web_frame, blink::WebNode(), PrintRequestType::kScripted,
+ false /* silent */, base::DictionaryValue() /* new_settings */);
if (weak_this)
@@ -1197,7 +1199,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
web_frame->DispatchAfterPrintEvent();
@@ -1170,7 +1172,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
receivers_.Add(this, std::move(receiver));
}
@ -485,25 +473,26 @@ index ab63f19db624b62a4be7539831f371c8a0c7dcfa..780c090157b179d9bf8a33bbbb7b14f7
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
if (ipc_nesting_level_ > 1)
return;
@@ -1214,7 +1216,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
@@ -1185,7 +1187,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
// that instead.
auto plugin = delegate_->GetPdfElement(frame);
// Pause between onbeforeprint and onafterprint events.
// https://html.spec.whatwg.org/C/#printing-steps
- Print(frame, plugin, PrintRequestType::kRegular,
+ Print(frame, plugin, PrintRequestType::kRegular, silent, std::move(settings),
blink::WebScopedPagePauser::Create());
- Print(frame, plugin, PrintRequestType::kRegular);
+ Print(frame, plugin, PrintRequestType::kRegular, silent, std::move(settings));
if (!render_frame_gone_)
@@ -1236,7 +1238,7 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
// Hand over control, including Print Preview's WebScopedPagePauser, to the
// system print dialog.
Print(frame, print_preview_context_.source_node(), PrintRequestType::kRegular,
- print_preview_context_.TakePauser());
+ false, base::DictionaryValue(), print_preview_context_.TakePauser());
frame->DispatchAfterPrintEvent();
@@ -1204,7 +1206,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
}
Print(frame, print_preview_context_.source_node(),
- PrintRequestType::kRegular);
+ PrintRequestType::kRegular, false,
+ base::DictionaryValue());
if (!render_frame_gone_)
print_preview_context_.DispatchAfterPrintEvent();
// WARNING: |this| may be gone at this point. Do not do any more work here and
@@ -1284,6 +1286,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
@@ -1252,6 +1255,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
if (ipc_nesting_level_ > 1)
return;
@ -512,27 +501,28 @@ index ab63f19db624b62a4be7539831f371c8a0c7dcfa..780c090157b179d9bf8a33bbbb7b14f7
print_preview_context_.OnPrintPreview();
if (print_preview_context_.IsForArc()) {
@@ -1836,7 +1840,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
@@ -1788,7 +1793,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
return;
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
- PrintRequestType::kRegular, blink::WebScopedPagePauser::Create());
- PrintRequestType::kRegular);
+ PrintRequestType::kRegular, false /* silent */,
+ base::DictionaryValue() /* new_settings */,
+ blink::WebScopedPagePauser::Create());
+ base::DictionaryValue() /* new_settings */);
// Check if |this| is still valid.
if (!weak_this)
return;
@@ -1853,6 +1859,8 @@ void PrintRenderFrameHelper::Print(
blink::WebLocalFrame* frame,
const blink::WebNode& node,
PrintRequestType print_request_type,
+ bool silent,
+ base::Value settings,
std::unique_ptr<blink::WebScopedPagePauser> pauser) {
@@ -1803,7 +1809,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
- PrintRequestType print_request_type) {
+ PrintRequestType print_request_type,
+ bool silent,
+ base::Value settings) {
// If still not finished with earlier print request simply ignore.
if (prep_frame_view_)
@@ -1861,7 +1869,7 @@ void PrintRenderFrameHelper::Print(
return;
@@ -1811,7 +1819,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
FrameReference frame_ref(frame);
uint32_t expected_page_count = 0;
@ -541,12 +531,12 @@ index ab63f19db624b62a4be7539831f371c8a0c7dcfa..780c090157b179d9bf8a33bbbb7b14f7
DidFinishPrinting(FAIL_PRINT_INIT);
return; // Failed to init print page settings.
}
@@ -1880,10 +1888,41 @@ void PrintRenderFrameHelper::Print(
@@ -1830,10 +1838,41 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
print_pages_params_->params->print_scaling_option;
mojom::PrintPagesParams print_settings;
- print_settings.params = mojom::PrintParams::New();
+
+
auto self = weak_ptr_factory_.GetWeakPtr();
- GetPrintSettingsFromUser(frame_ref.GetFrame(), node, expected_page_count,
- print_request_type, &print_settings);
@ -586,8 +576,8 @@ index ab63f19db624b62a4be7539831f371c8a0c7dcfa..780c090157b179d9bf8a33bbbb7b14f7
// Check if |this| is still valid.
if (!self)
return;
@@ -2130,11 +2169,24 @@ void PrintRenderFrameHelper::IPCProcessed() {
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
@@ -2077,7 +2116,9 @@ void PrintRenderFrameHelper::IPCProcessed() {
}
}
-bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
@ -596,25 +586,8 @@ index ab63f19db624b62a4be7539831f371c8a0c7dcfa..780c090157b179d9bf8a33bbbb7b14f7
+ const base::DictionaryValue& new_settings) {
mojom::PrintPagesParams settings;
settings.params = mojom::PrintParams::New();
- Send(new PrintHostMsg_GetDefaultPrintSettings(routing_id(),
- settings.params.get()));
+ if (new_settings.empty()) {
+ // Send the default IPC message if caller is window.print()
+ Send(new PrintHostMsg_GetDefaultPrintSettings(routing_id(),
+ settings.params.get()));
+ } else {
+ // Send the update IPC message if caller is webContents.print()
+ bool canceled = false;
+ Send(new PrintHostMsg_UpdatePrintSettings(
+ routing_id(), 0, new_settings, &settings, &canceled));
+ if (canceled)
+ return false;
+ }
+
// 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.
@@ -2154,12 +2206,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
GetPrintManagerHost()->GetDefaultPrintSettings(&settings.params);
@@ -2101,12 +2142,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
return result;
}
@ -634,10 +607,10 @@ index ab63f19db624b62a4be7539831f371c8a0c7dcfa..780c090157b179d9bf8a33bbbb7b14f7
GetPrintManagerHost()->ShowInvalidPrinterSettingsError();
return false;
diff --git a/components/printing/renderer/print_render_frame_helper.h b/components/printing/renderer/print_render_frame_helper.h
index 00393383967e0c542edbd7ef2798ef6ddd6c6291..f06149f97b5a91b7e2c3d1aa5d80d46283e8a882 100644
index 78d76aadc206a0922163f87f0575ca0cfe344880..d51fff55ebd5c9d1a39637039b279b491d025b08 100644
--- a/components/printing/renderer/print_render_frame_helper.h
+++ b/components/printing/renderer/print_render_frame_helper.h
@@ -231,7 +231,7 @@ class PrintRenderFrameHelper
@@ -230,7 +230,7 @@ class PrintRenderFrameHelper
mojo::PendingAssociatedReceiver<mojom::PrintRenderFrame> receiver);
// printing::mojom::PrintRenderFrame:
@ -646,16 +619,18 @@ index 00393383967e0c542edbd7ef2798ef6ddd6c6291..f06149f97b5a91b7e2c3d1aa5d80d462
void PrintForSystemDialog() override;
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
void SetPrintPreviewUI(
@@ -299,6 +299,8 @@ class PrintRenderFrameHelper
@@ -297,7 +297,9 @@ class PrintRenderFrameHelper
// WARNING: |this| may be gone after this method returns.
void Print(blink::WebLocalFrame* frame,
const blink::WebNode& node,
PrintRequestType print_request_type,
- PrintRequestType print_request_type);
+ PrintRequestType print_request_type,
+ bool silent,
+ base::Value settings,
std::unique_ptr<blink::WebScopedPagePauser> pauser);
+ base::Value settings);
// Notification when printing is done - signal tear-down/free resources.
@@ -308,12 +310,14 @@ class PrintRenderFrameHelper
void DidFinishPrinting(PrintingResult result);
@@ -306,12 +308,14 @@ class PrintRenderFrameHelper
// Initialize print page settings with default settings.
// Used only for native printing workflow.
@ -673,10 +648,10 @@ index 00393383967e0c542edbd7ef2798ef6ddd6c6291..f06149f97b5a91b7e2c3d1aa5d80d462
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
// Set options for print preset from source PDF document.
diff --git a/printing/printing_context.cc b/printing/printing_context.cc
index 14ec2b673afe6fc0ecfce8028a432f5bcfc9e104..5a1853c4f8e70143e9b1be3dcab7f1dff448346d 100644
index 49e0e83868dc8f4e32eab5b08172f0697552a532..eb8fd82289e6bb370934883c039bdde704604768 100644
--- a/printing/printing_context.cc
+++ b/printing/printing_context.cc
@@ -95,7 +95,6 @@ PrintingContext::Result PrintingContext::UsePdfSettings() {
@@ -96,7 +96,6 @@ PrintingContext::Result PrintingContext::UsePdfSettings() {
PrintingContext::Result PrintingContext::UpdatePrintSettings(
base::Value job_settings) {
@ -685,10 +660,10 @@ index 14ec2b673afe6fc0ecfce8028a432f5bcfc9e104..5a1853c4f8e70143e9b1be3dcab7f1df
std::unique_ptr<PrintSettings> settings =
PrintSettingsFromJobSettings(job_settings);
diff --git a/printing/printing_context.h b/printing/printing_context.h
index 7ac9ce996ca7cbf8bcd21cb0c8161b63050ff684..43f5383bfed965c3d8cd3102dc18309a65c457ae 100644
index 896d1b26f492862b3ae501ca5b756cfb201d1c75..a3762cb0e222d425359bd803c8406f7a11b59ade 100644
--- a/printing/printing_context.h
+++ b/printing/printing_context.h
@@ -133,12 +133,12 @@ class PRINTING_EXPORT PrintingContext {
@@ -134,12 +134,12 @@ class PRINTING_EXPORT PrintingContext {
int job_id() const { return job_id_; }