chore: bump chromium to ec5bc1743792d64724693eb357083 (master) (#24984)
* chore: bump chromium in DEPS to cbdeef954dfc34e94c8ca9cf72ad326b4a121158 * chore: bump chromium in DEPS to 29723f905baeab1d4228eef2c31cdb341ebeffe0 * chore: bump chromium in DEPS to 44d6d78e852137fff58c14ed26ab1e803e5bf822 * update patches * chore: bump chromium in DEPS to 8a3a0fccb39d6b8334c9a0496c0d5056e50cdb3f * chore: update patches * refactor: fix PrintBackend::CreateInstance() calls Refs:2354541
* chore: bump chromium in DEPS to b9ebec3bcb1cabdd1426f367636f54cc98e0500e * chore: remove patches to code that was deleted upstream CL:2360314
* Remove uses of kCGColorSpaceITUR_2020_PQ_EOTF/HLG CL:2363950
just garden variety code shear * chore: update patch indices * Move ColorModel to //printing/mojom/print.mojom2355083
sync with printing ColorModel changes: moved to mojo, different naming scheme * chore: bump chromium in DEPS to 56c4b4d2ce5ba941acd2e0fdb5100e8a48847134 * chore: bump chromium in DEPS to 130501f220b684a79dc82c17e236e63ac1f2a093 * Convert PrintHostMsg_DidGetPrintedPagesCount to Mojo2326857
Update argument list to Print() * chore: update patch indices * DumpAccTree: convert utf16 to utf8 in PropertyFilter2360218
* chore: bump chromium in DEPS to 3058368c6646e0dc8be6f8ea838b0343428b7998 * chore: bump chromium in DEPS to f51b4e6555364363c61438dac7afd988c8347bfc * chore: bump chromium in DEPS to 2dcc6f8fc23ac41b2499eb69dee0b4017e9d1046 * update patches * chore: bump chromium in DEPS to 2d8e98ecedc7e4905540b053bc1c87e964715be5 * update patches * 2345900: Move content::RecordContentToVisibleTimeRequest struct to mojo2345900
* update patches * 2345900: Move content::RecordContentToVisibleTimeRequest struct to mojo2345900
* 2367394: Remove net::LOAD_DO_NOT_SEND_COOKIES and net::LOAD_DO_NOT_SEND_AUTH_DATA.2367394
* 2373227: [XProto] Consolidate all <X11/*> includes to //ui/gfx/x/x11.h2373227
* fixup! 2373227: [XProto] Consolidate all <X11/*> includes to //ui/gfx/x/x11.h * chore: bump chromium in DEPS to c090e3f960520cbd2328608b97f87238c76d6143 * update patches * chore: bump chromium in DEPS to 13a25e0a755de9a14271022c595f3d2e29829e1a * chore: bump chromium in DEPS to 6adbb767b012c41efaeab0d1bdbb3eefed0977bc * chore: bump chromium in DEPS to 339ec5455c5932ef1322ea9953a6349b0732199e * chore: bump chromium in DEPS to 20291807c33f7ef4ef4f57d62075e099b027bfe6 * chore: bump chromium in DEPS to 226fbd1b8b17d4ac84fdb9548ef3a1c646878d47 * update patches * fixup disable_color_correct_rendering patch * chore: bump chromium in DEPS to 577c45979cad4359f2e206d68efd9317d3d79315 * update patches * viz: Rename RenderPass to CompositorRenderPass (and related types).2380730
* chore: bump chromium in DEPS to 37e2ad5303f2c03a1b5d8eda65341bf2561196cd * update patches * add kOmitCookies_Electron * update patch * chore: bump chromium in DEPS to 256e42409ea63a7e71016de07818a983a97db463 * update patches * fix worker script ready hook2335713
* Fixup printing page ranges patch * [printing] Move PrintMsg_PrintPages_Params to print.mojom2340854
* Add MIME sniffer overloads that take base::StringPieces2382896
* [printing] Move PrintHostMsg_PreviewIds to print.mojom2379455
* fixup test due to new DCHECK2333750
* stop sending cookies when useSessionCookies is false * chore: bump chromium in DEPS to dd429dbc556449951ee8160d8a4d61fd95a139d5 * update patches * chore: bump chromium in DEPS to 5202bde3f9f44c2065f5dacf27e7000dd19e4e4d * chore: bump chromium in DEPS to 099e8e07b89da65932431bb0fd51b6f7f5344c19 * chore: bump chromium in DEPS to 104e5da2a43b759732d5b94bfc750b3a9a639653 * chore: bump chromium in DEPS to a4519ce657af25834e355315fd7fefa77b13426a * update patches * Make FileURLLoaderFactory always owned by its |receivers_|.2337411
* Make FileURLLoaderFactory always owned by its |receivers_|.2337411
* chore: bump chromium in DEPS to 1b62e9e8c8eaf6b8e3a9c77ee67a4c1bfa6a4d6b * chore: update patches * fixup! Make FileURLLoaderFactory always owned by its |receivers_|. * chore: update patches - mac: Disable CoreServices _CSCheckFix.2401334
- [XProto] Remove bad DCHECK in x11_error_tracker.cc2402304
- Move content/browser/frame_host/* over to content/browser/renderer_host/2401303
* Refactor WebContentSettingsClient to dedupe AllowXYZ methods2353552
* Introduce NonNetworkURLLoaderFactoryBase class.2357559
* [XProto] Remove usage of all Xlib headers2392140
* fixup! chore: update patches * chore: bump chromium in DEPS to c1df55fbeb8207d036a604f59e4ea4e8ee79930a * chore: update patches * Move content::WebPreferences struct to Blink2397670
* chore: bump chromium in DEPS to 57a23ec4884fff6c2f8d9b8536131cdc9b551ec2 * Set appid on Pip windows.2388274
* fixup! Set appid on Pip windows. * fix: add a patch to remove deprecated factory * chore: bump chromium in DEPS to 1a9ddb7ea43955877823d5c4dcbf241b64228635 * fix compilation on windows * chore: bump chromium in DEPS to 234e6c6a77f61ffad9335099d9b13892cf88fd44 * chore: update patches * chore: bump chromium in DEPS to 7631eb0a9f57a8a47d3c28e1d265961b3a4d6b2b * chore: update patches * chore: bump chromium in DEPS to f9c34cd485845b95c2d17a7f55fdf92cda9a1b3a * chore: update patches * chore: implement GetSurveyAPIKey Refs:2362182
* chore: replace CreateWebUIURLLoader with CreateWebUIURLLoaderFactory Refs:2358309
* chore: bump chromium in DEPS to 5bdbd2373da884adf41c087be1465fcc344d168c * chore: update node patches for common.gypi * chore: update patches * chore: non_network_url_loader_factory_base was moved Refs:2357431
* 2415752: Reland "Reland "OOR-CORS: Remove BlinkCORS supporting code outside Blink"" Refs:2415752
* chore: bump chromium in DEPS to b943d006a33ec5bc1743792d64724693eb357083 * fix: replace x11::None with x11::Window::None * chore: update patches * chore: update patches * fix: cast x11::Window to int * 2402123: Use end date when deleting http auth cache Refs:2402123
* 2320268: Migrate DragHostMsg_StartDragging to Mojo Refs:2320268
* 2401303: Move content/browser/frame_host/* over to content/browser/renderer_host/2401303
* chore: fix lint * chore: fix build * Update config.yml Co-authored-by: Electron Bot <anonymous@electronjs.org> Co-authored-by: Charles Kerr <charles@charleskerr.com> Co-authored-by: Jeremy Rose <nornagon@nornagon.net> Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: deepak1556 <hop2deep@gmail.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com> Co-authored-by: Samuel Attard <sattard@slack-corp.com>
This commit is contained in:
parent
e50d6e47c4
commit
69f1731bbb
107 changed files with 956 additions and 853 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/chrome/browser/printing/print_job.cc b/chrome/browser/printing/print_job.cc
|
||||
index 668a14bff461e83b2c6d9d7f23d9674ff081ef12..674f141e80c0316fd47558c4d428a9706ac5a7b6 100644
|
||||
index 4f3b68135f9bb29f2c36055f50e1725a9b36a856..ece3d14f3b7c585b52676ad9b8dde0b3f7bae0c6 100644
|
||||
--- a/chrome/browser/printing/print_job.cc
|
||||
+++ b/chrome/browser/printing/print_job.cc
|
||||
@@ -353,12 +353,14 @@ void PrintJob::StartPdfToEmfConversion(
|
||||
@@ -355,12 +355,14 @@ void PrintJob::StartPdfToEmfConversion(
|
||||
// TODO(thestig): Figure out why crbug.com/1083911 occurred, which is likely
|
||||
// because |web_contents| was null. As a result, this section has many more
|
||||
// pointer checks to avoid crashing.
|
||||
|
@ -31,10 +31,10 @@ index 668a14bff461e83b2c6d9d7f23d9674ff081ef12..674f141e80c0316fd47558c4d428a970
|
|||
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 977ad787270844b218a87fbe04fea616619e84ba..592fe4459cdae22d23a933a31c452c44992feb95 100644
|
||||
index 49894fbab5d7cd265cce27e49debf747c188bbd3..db4923ce99f3c78bc15bed7cfdf9a71adb516adf 100644
|
||||
--- a/chrome/browser/printing/print_job_worker.cc
|
||||
+++ b/chrome/browser/printing/print_job_worker.cc
|
||||
@@ -20,7 +20,6 @@
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "chrome/browser/browser_process.h"
|
||||
#include "chrome/browser/chrome_notification_types.h"
|
||||
#include "chrome/browser/printing/print_job.h"
|
||||
|
@ -42,7 +42,7 @@ index 977ad787270844b218a87fbe04fea616619e84ba..592fe4459cdae22d23a933a31c452c44
|
|||
#include "components/crash/core/common/crash_keys.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/browser_thread.h"
|
||||
@@ -28,6 +27,7 @@
|
||||
@@ -29,6 +28,7 @@
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
#include "printing/backend/print_backend.h"
|
||||
|
@ -50,7 +50,7 @@ index 977ad787270844b218a87fbe04fea616619e84ba..592fe4459cdae22d23a933a31c452c44
|
|||
#include "printing/print_job_constants.h"
|
||||
#include "printing/printed_document.h"
|
||||
#include "printing/printing_utils.h"
|
||||
@@ -235,16 +235,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
|
||||
@@ -236,16 +236,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
|
||||
#endif // defined(OS_LINUX) && defined(USE_CUPS) && !defined(OS_CHROMEOS)
|
||||
}
|
||||
|
||||
|
@ -75,7 +75,7 @@ index 977ad787270844b218a87fbe04fea616619e84ba..592fe4459cdae22d23a933a31c452c44
|
|||
}
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
@@ -260,6 +265,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
|
||||
@@ -261,6 +266,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
|
||||
|
||||
void PrintJobWorker::GetSettingsDone(SettingsCallback callback,
|
||||
PrintingContext::Result result) {
|
||||
|
@ -90,10 +90,10 @@ index 977ad787270844b218a87fbe04fea616619e84ba..592fe4459cdae22d23a933a31c452c44
|
|||
}
|
||||
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
|
||||
index 2917e93c3f22b3bcbe683c2b944c7af25e66f950..33f48f473efd04e165ec7b9a8738b8d7c18a6adc 100644
|
||||
index fb2a4c003b1d71e321c69faadbef64b8e6f8adb4..8f5d4647f8c0417d03a8f15ef5945512b4acca96 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.cc
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.cc
|
||||
@@ -27,10 +27,7 @@
|
||||
@@ -28,10 +28,7 @@
|
||||
#include "chrome/browser/printing/print_view_manager_common.h"
|
||||
#include "chrome/browser/printing/printer_query.h"
|
||||
#include "chrome/browser/profiles/profile.h"
|
||||
|
@ -104,7 +104,7 @@ index 2917e93c3f22b3bcbe683c2b944c7af25e66f950..33f48f473efd04e165ec7b9a8738b8d7
|
|||
#include "chromeos/constants/chromeos_features.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "components/printing/browser/print_composite_client.h"
|
||||
@@ -47,6 +44,7 @@
|
||||
@@ -48,6 +45,7 @@
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
|
@ -112,7 +112,7 @@ index 2917e93c3f22b3bcbe683c2b944c7af25e66f950..33f48f473efd04e165ec7b9a8738b8d7
|
|||
#include "mojo/public/cpp/system/buffer.h"
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
#include "printing/metafile_skia.h"
|
||||
@@ -70,6 +68,8 @@ using PrintSettingsCallback =
|
||||
@@ -71,6 +69,8 @@ using PrintSettingsCallback =
|
||||
base::OnceCallback<void(std::unique_ptr<PrinterQuery>)>;
|
||||
|
||||
void ShowWarningMessageBox(const base::string16& message) {
|
||||
|
@ -121,7 +121,7 @@ index 2917e93c3f22b3bcbe683c2b944c7af25e66f950..33f48f473efd04e165ec7b9a8738b8d7
|
|||
// Runs always on the UI thread.
|
||||
static bool is_dialog_shown = false;
|
||||
if (is_dialog_shown)
|
||||
@@ -78,6 +78,7 @@ void ShowWarningMessageBox(const base::string16& message) {
|
||||
@@ -79,6 +79,7 @@ void ShowWarningMessageBox(const base::string16& message) {
|
||||
base::AutoReset<bool> auto_reset(&is_dialog_shown, true);
|
||||
|
||||
chrome::ShowWarningMessageBox(nullptr, base::string16(), message);
|
||||
|
@ -129,8 +129,8 @@ index 2917e93c3f22b3bcbe683c2b944c7af25e66f950..33f48f473efd04e165ec7b9a8738b8d7
|
|||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
@@ -116,12 +117,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
|
||||
printing_succeeded_(false),
|
||||
@@ -115,12 +116,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
|
||||
: PrintManager(web_contents),
|
||||
queue_(g_browser_process->print_job_manager()->queue()) {
|
||||
DCHECK(queue_);
|
||||
+#if 0
|
||||
|
@ -144,7 +144,7 @@ index 2917e93c3f22b3bcbe683c2b944c7af25e66f950..33f48f473efd04e165ec7b9a8738b8d7
|
|||
}
|
||||
|
||||
PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
@@ -129,7 +132,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
@@ -128,7 +131,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
DisconnectFromCurrentPrintJob();
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,7 @@ index 2917e93c3f22b3bcbe683c2b944c7af25e66f950..33f48f473efd04e165ec7b9a8738b8d7
|
|||
DisconnectFromCurrentPrintJob();
|
||||
|
||||
// Don't print / print preview crashed tabs.
|
||||
@@ -137,7 +143,14 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
|
||||
@@ -136,7 +142,14 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
|
||||
return false;
|
||||
|
||||
SetPrintingRFH(rfh);
|
||||
|
@ -172,7 +172,7 @@ index 2917e93c3f22b3bcbe683c2b944c7af25e66f950..33f48f473efd04e165ec7b9a8738b8d7
|
|||
return true;
|
||||
}
|
||||
|
||||
@@ -258,9 +271,9 @@ void PrintViewManagerBase::StartLocalPrintJob(
|
||||
@@ -257,9 +270,9 @@ void PrintViewManagerBase::StartLocalPrintJob(
|
||||
void PrintViewManagerBase::UpdatePrintingEnabled() {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
// The Unretained() is safe because ForEachFrame() is synchronous.
|
||||
|
@ -185,8 +185,8 @@ index 2917e93c3f22b3bcbe683c2b944c7af25e66f950..33f48f473efd04e165ec7b9a8738b8d7
|
|||
}
|
||||
|
||||
void PrintViewManagerBase::NavigationStopped() {
|
||||
@@ -363,7 +376,7 @@ void PrintViewManagerBase::OnPrintingFailed(int cookie) {
|
||||
PrintManager::OnPrintingFailed(cookie);
|
||||
@@ -371,7 +384,7 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) {
|
||||
PrintManager::PrintingFailed(cookie);
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
- ShowPrintErrorDialog();
|
||||
|
@ -194,10 +194,10 @@ index 2917e93c3f22b3bcbe683c2b944c7af25e66f950..33f48f473efd04e165ec7b9a8738b8d7
|
|||
#endif
|
||||
|
||||
ReleasePrinterQuery();
|
||||
@@ -382,6 +395,11 @@ void PrintViewManagerBase::OnScriptedPrint(
|
||||
@@ -390,6 +403,11 @@ void PrintViewManagerBase::OnScriptedPrint(
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::OnShowInvalidPrinterSettingsError() {
|
||||
void PrintViewManagerBase::ShowInvalidPrinterSettingsError() {
|
||||
+ if (!callback_.is_null()) {
|
||||
+ std::string cb_str = "Invalid printer settings";
|
||||
+ std::move(callback_).Run(printing_succeeded_, cb_str);
|
||||
|
@ -206,7 +206,7 @@ index 2917e93c3f22b3bcbe683c2b944c7af25e66f950..33f48f473efd04e165ec7b9a8738b8d7
|
|||
base::ThreadTaskRunnerHandle::Get()->PostTask(
|
||||
FROM_HERE, base::BindOnce(&ShowWarningMessageBox,
|
||||
l10n_util::GetStringUTF16(
|
||||
@@ -463,9 +481,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
|
||||
@@ -459,9 +477,13 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
|
||||
content::NotificationService::NoDetails());
|
||||
break;
|
||||
}
|
||||
|
@ -222,7 +222,7 @@ index 2917e93c3f22b3bcbe683c2b944c7af25e66f950..33f48f473efd04e165ec7b9a8738b8d7
|
|||
NOTREACHED();
|
||||
break;
|
||||
}
|
||||
@@ -560,8 +582,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
@@ -557,8 +579,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
DCHECK(!quit_inner_loop_);
|
||||
DCHECK(query);
|
||||
|
||||
|
@ -235,7 +235,7 @@ index 2917e93c3f22b3bcbe683c2b944c7af25e66f950..33f48f473efd04e165ec7b9a8738b8d7
|
|||
|
||||
// We can't print if there is no renderer.
|
||||
if (!web_contents()->GetRenderViewHost() ||
|
||||
@@ -582,8 +606,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
@@ -579,8 +603,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
print_job_->SetSource(source, /*source_id=*/"");
|
||||
#endif
|
||||
|
||||
|
@ -244,7 +244,7 @@ index 2917e93c3f22b3bcbe683c2b944c7af25e66f950..33f48f473efd04e165ec7b9a8738b8d7
|
|||
printing_succeeded_ = false;
|
||||
return true;
|
||||
}
|
||||
@@ -632,14 +654,22 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
@@ -629,14 +651,22 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
content::RenderFrameHost* rfh = printing_rfh_;
|
||||
printing_rfh_ = nullptr;
|
||||
|
||||
|
@ -269,7 +269,7 @@ index 2917e93c3f22b3bcbe683c2b944c7af25e66f950..33f48f473efd04e165ec7b9a8738b8d7
|
|||
// Don't close the worker thread.
|
||||
print_job_ = nullptr;
|
||||
}
|
||||
@@ -675,7 +705,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||
@@ -672,7 +702,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||
}
|
||||
|
||||
bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
|
||||
|
@ -279,10 +279,10 @@ index 2917e93c3f22b3bcbe683c2b944c7af25e66f950..33f48f473efd04e165ec7b9a8738b8d7
|
|||
|
||||
if (!cookie) {
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
|
||||
index 9ad03ae28904050d540661038f6ba15b7a5c5c54..6d1c4f338dde79abddbaf3ad55500c4e7e8767ec 100644
|
||||
index 32832869dc4f578442329a2ed9ce6a4cd4bb4dc9..f168bb2e732fb3ced929655a47a32ab04820edaa 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.h
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.h
|
||||
@@ -34,6 +34,8 @@ class PrintJob;
|
||||
@@ -38,6 +38,8 @@ class PrintJob;
|
||||
class PrintQueriesQueue;
|
||||
class PrinterQuery;
|
||||
|
||||
|
@ -291,7 +291,7 @@ index 9ad03ae28904050d540661038f6ba15b7a5c5c54..6d1c4f338dde79abddbaf3ad55500c4e
|
|||
// Base class for managing the print commands for a WebContents.
|
||||
class PrintViewManagerBase : public content::NotificationObserver,
|
||||
public PrintManager {
|
||||
@@ -43,7 +45,10 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
||||
@@ -47,7 +49,10 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
||||
// 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.
|
||||
|
@ -303,15 +303,15 @@ index 9ad03ae28904050d540661038f6ba15b7a5c5c54..6d1c4f338dde79abddbaf3ad55500c4e
|
|||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
// Prints the document in |print_data| with settings specified in
|
||||
@@ -208,9 +213,15 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
||||
@@ -214,9 +219,15 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
||||
// The current RFH that is printing with a system printing dialog.
|
||||
content::RenderFrameHost* printing_rfh_;
|
||||
content::RenderFrameHost* printing_rfh_ = nullptr;
|
||||
|
||||
+ // Respond with success of the print job.
|
||||
+ CompletionCallback callback_;
|
||||
+
|
||||
// Indication of success of the print job.
|
||||
bool printing_succeeded_;
|
||||
bool printing_succeeded_ = false;
|
||||
|
||||
+ // Indication of whether the print job was manually cancelled
|
||||
+ bool printing_cancelled_ = false;
|
||||
|
@ -320,18 +320,18 @@ index 9ad03ae28904050d540661038f6ba15b7a5c5c54..6d1c4f338dde79abddbaf3ad55500c4e
|
|||
// 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 64569c4c89b1e034a19b85bb3f6443d3ab76fcd8..164368028a6f3cf14ed6199e0f69717c514090a6 100644
|
||||
index 0a8ead2ee790ed549136d6bb7e81c0d77e3e5ac2..06b5561f386efbeaa7474c3ccb2218d8694d0c9b 100644
|
||||
--- a/chrome/browser/printing/printing_message_filter.cc
|
||||
+++ b/chrome/browser/printing/printing_message_filter.cc
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "components/keyed_service/content/browser_context_keyed_service_shutdown_notifier_factory.h"
|
||||
@@ -22,6 +22,7 @@
|
||||
#include "components/printing/browser/print_manager_utils.h"
|
||||
#include "components/printing/common/print.mojom.h"
|
||||
#include "components/printing/common/print_messages.h"
|
||||
+#include "content/public/browser/browser_context.h"
|
||||
#include "content/public/browser/browser_task_traits.h"
|
||||
#include "content/public/browser/render_frame_host.h"
|
||||
#include "content/public/browser/web_contents.h"
|
||||
@@ -90,19 +91,22 @@ void PrintingMessageFilter::SetDelegateForTesting(TestDelegate* delegate) {
|
||||
@@ -91,19 +92,22 @@ void PrintingMessageFilter::SetDelegateForTesting(TestDelegate* delegate) {
|
||||
g_test_delegate = delegate;
|
||||
}
|
||||
|
||||
|
@ -357,7 +357,7 @@ index 64569c4c89b1e034a19b85bb3f6443d3ab76fcd8..164368028a6f3cf14ed6199e0f69717c
|
|||
}
|
||||
|
||||
PrintingMessageFilter::~PrintingMessageFilter() {
|
||||
@@ -137,11 +141,13 @@ bool PrintingMessageFilter::OnMessageReceived(const IPC::Message& message) {
|
||||
@@ -138,11 +142,13 @@ bool PrintingMessageFilter::OnMessageReceived(const IPC::Message& message) {
|
||||
|
||||
void PrintingMessageFilter::OnGetDefaultPrintSettings(IPC::Message* reply_msg) {
|
||||
DCHECK_CURRENTLY_ON(BrowserThread::IO);
|
||||
|
@ -371,7 +371,7 @@ index 64569c4c89b1e034a19b85bb3f6443d3ab76fcd8..164368028a6f3cf14ed6199e0f69717c
|
|||
std::unique_ptr<PrinterQuery> printer_query = queue_->PopPrinterQuery(0);
|
||||
if (!printer_query) {
|
||||
printer_query =
|
||||
@@ -225,12 +231,13 @@ void PrintingMessageFilter::OnScriptedPrintReply(
|
||||
@@ -226,12 +232,13 @@ void PrintingMessageFilter::OnScriptedPrintReply(
|
||||
void PrintingMessageFilter::OnUpdatePrintSettings(int document_cookie,
|
||||
base::Value job_settings,
|
||||
IPC::Message* reply_msg) {
|
||||
|
@ -386,20 +386,20 @@ index 64569c4c89b1e034a19b85bb3f6443d3ab76fcd8..164368028a6f3cf14ed6199e0f69717c
|
|||
if (!job_settings.is_dict() ||
|
||||
!job_settings.FindIntKey(kSettingPrinterType)) {
|
||||
// Reply with null query.
|
||||
@@ -263,7 +270,9 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
|
||||
std::unique_ptr<PrinterQuery> printer_query,
|
||||
@@ -265,7 +272,9 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
|
||||
IPC::Message* reply_msg) {
|
||||
PrintMsg_PrintPages_Params params;
|
||||
- if (!printer_query || printer_query->last_status() != PrintingContext::OK) {
|
||||
mojom::PrintPagesParams params;
|
||||
params.params = mojom::PrintParams::New();
|
||||
- if (printer_query && printer_query->last_status() == PrintingContext::OK) {
|
||||
+ // We call update without first printing from defaults,
|
||||
+ // so the last printer status will still be defaulted to PrintingContext::FAILED
|
||||
+ if (!printer_query) {
|
||||
params.Reset();
|
||||
} else {
|
||||
RenderParamsFromPrintSettings(printer_query->settings(), ¶ms.params);
|
||||
@@ -301,7 +310,7 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
|
||||
+ if (printer_query) {
|
||||
RenderParamsFromPrintSettings(printer_query->settings(),
|
||||
params.params.get());
|
||||
params.params->document_cookie = printer_query->cookie();
|
||||
@@ -302,7 +311,7 @@ void PrintingMessageFilter::OnUpdatePrintSettingsReply(
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
void PrintingMessageFilter::OnCheckForCancel(const PrintHostMsg_PreviewIds& ids,
|
||||
void PrintingMessageFilter::OnCheckForCancel(const mojom::PreviewIds& ids,
|
||||
bool* cancel) {
|
||||
- *cancel = PrintPreviewUI::ShouldCancelRequest(ids);
|
||||
+ *cancel = false;
|
||||
|
@ -407,11 +407,11 @@ index 64569c4c89b1e034a19b85bb3f6443d3ab76fcd8..164368028a6f3cf14ed6199e0f69717c
|
|||
#endif
|
||||
|
||||
diff --git a/chrome/browser/printing/printing_message_filter.h b/chrome/browser/printing/printing_message_filter.h
|
||||
index adb4ff6ece476a99ae12d9e3ecfb78931c04c81e..894148c8847b333be8636907e85476dcd46862e2 100644
|
||||
index 1431e6c24b325bc32dd66f35895fdbd9a08f8eb6..13c4d30a2ac1bd2b1b589bddae49274ab4eef61e 100644
|
||||
--- a/chrome/browser/printing/printing_message_filter.h
|
||||
+++ b/chrome/browser/printing/printing_message_filter.h
|
||||
@@ -24,6 +24,10 @@ struct PrintHostMsg_PreviewIds;
|
||||
struct PrintHostMsg_ScriptedPrint_Params;
|
||||
@@ -22,6 +22,10 @@
|
||||
|
||||
class Profile;
|
||||
|
||||
+namespace content {
|
||||
|
@ -421,7 +421,7 @@ index adb4ff6ece476a99ae12d9e3ecfb78931c04c81e..894148c8847b333be8636907e85476dc
|
|||
namespace printing {
|
||||
|
||||
class PrintQueriesQueue;
|
||||
@@ -44,7 +48,8 @@ class PrintingMessageFilter : public content::BrowserMessageFilter {
|
||||
@@ -42,7 +46,8 @@ class PrintingMessageFilter : public content::BrowserMessageFilter {
|
||||
|
||||
static void SetDelegateForTesting(TestDelegate* delegate);
|
||||
|
||||
|
@ -432,10 +432,10 @@ index adb4ff6ece476a99ae12d9e3ecfb78931c04c81e..894148c8847b333be8636907e85476dc
|
|||
// content::BrowserMessageFilter:
|
||||
bool OnMessageReceived(const IPC::Message& message) override;
|
||||
diff --git a/components/printing/common/print.mojom b/components/printing/common/print.mojom
|
||||
index 948c86689c2779a8dc41b458ac670ec8a94e0efa..2e160658ff5ea814b9133c925e8b461a0d9bcfbc 100644
|
||||
index 3a8f9c3c3c14d1ed8f2047ab7d9aafb34f74bb55..e70ee384970ce4731ba59a835fc502fdd8e89cd4 100644
|
||||
--- a/components/printing/common/print.mojom
|
||||
+++ b/components/printing/common/print.mojom
|
||||
@@ -197,7 +197,7 @@ interface PrintPreviewUI {
|
||||
@@ -230,7 +230,7 @@ interface PrintPreviewUI {
|
||||
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.
|
||||
|
@ -445,10 +445,10 @@ index 948c86689c2779a8dc41b458ac670ec8a94e0efa..2e160658ff5ea814b9133c925e8b461a
|
|||
// 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 788257825daa531d2f878c4ee53272dd265dc8aa..e25c8cb1be55df8ae3af62a5738fc3813fa5d2e0 100644
|
||||
index ab63f19db624b62a4be7539831f371c8a0c7dcfa..780c090157b179d9bf8a33bbbb7b14f702e854c3 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -40,6 +40,7 @@
|
||||
@@ -38,6 +38,7 @@
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
#include "printing/metafile_skia.h"
|
||||
#include "printing/mojom/print.mojom.h"
|
||||
|
@ -456,17 +456,15 @@ index 788257825daa531d2f878c4ee53272dd265dc8aa..e25c8cb1be55df8ae3af62a5738fc381
|
|||
#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"
|
||||
@@ -1156,7 +1157,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
web_frame->DispatchBeforePrintEvent();
|
||||
if (!weak_this)
|
||||
return;
|
||||
- Print(web_frame, blink::WebNode(), PrintRequestType::kScripted);
|
||||
+ Print(web_frame, blink::WebNode(), PrintRequestType::kScripted,
|
||||
+ false /* silent */, base::DictionaryValue() /* new_settings */);
|
||||
@@ -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());
|
||||
|
||||
if (weak_this)
|
||||
web_frame->DispatchAfterPrintEvent();
|
||||
}
|
||||
@@ -1177,7 +1179,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
|
||||
@@ -1197,7 +1199,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
|
||||
receivers_.Add(this, std::move(receiver));
|
||||
}
|
||||
|
||||
|
@ -475,25 +473,25 @@ index 788257825daa531d2f878c4ee53272dd265dc8aa..e25c8cb1be55df8ae3af62a5738fc381
|
|||
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
|
||||
if (ipc_nesting_level_ > 1)
|
||||
return;
|
||||
@@ -1191,7 +1193,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
|
||||
// If we are printing a PDF extension frame, find the plugin node and print
|
||||
// that instead.
|
||||
auto plugin = delegate_->GetPdfElement(frame);
|
||||
- Print(frame, plugin, PrintRequestType::kRegular);
|
||||
+ Print(frame, plugin, PrintRequestType::kRegular, silent, std::move(settings));
|
||||
@@ -1214,7 +1216,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
|
||||
|
||||
// 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());
|
||||
|
||||
if (!render_frame_gone_)
|
||||
frame->DispatchAfterPrintEvent();
|
||||
// WARNING: |this| may be gone at this point. Do not do any more work here and
|
||||
@@ -1208,7 +1210,7 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
|
||||
return;
|
||||
}
|
||||
Print(frame, print_preview_context_.source_node(),
|
||||
- PrintRequestType::kRegular);
|
||||
+ PrintRequestType::kRegular, false, base::DictionaryValue());
|
||||
@@ -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());
|
||||
if (!render_frame_gone_)
|
||||
frame->DispatchAfterPrintEvent();
|
||||
print_preview_context_.DispatchAfterPrintEvent();
|
||||
// WARNING: |this| may be gone at this point. Do not do any more work here and
|
||||
@@ -1256,6 +1258,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
|
||||
@@ -1284,6 +1286,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
|
||||
if (ipc_nesting_level_ > 1)
|
||||
return;
|
||||
|
||||
|
@ -502,52 +500,81 @@ index 788257825daa531d2f878c4ee53272dd265dc8aa..e25c8cb1be55df8ae3af62a5738fc381
|
|||
print_preview_context_.OnPrintPreview();
|
||||
|
||||
if (print_preview_context_.IsForArc()) {
|
||||
@@ -1790,7 +1794,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -1836,7 +1840,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
return;
|
||||
|
||||
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
|
||||
- PrintRequestType::kRegular);
|
||||
+ PrintRequestType::kRegular,
|
||||
+ false /* silent */,
|
||||
+ base::DictionaryValue() /* new_settings */);
|
||||
- PrintRequestType::kRegular, blink::WebScopedPagePauser::Create());
|
||||
+ PrintRequestType::kRegular, false /* silent */,
|
||||
+ base::DictionaryValue() /* new_settings */,
|
||||
+ blink::WebScopedPagePauser::Create());
|
||||
// Check if |this| is still valid.
|
||||
if (!weak_this)
|
||||
return;
|
||||
@@ -1805,7 +1811,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) {
|
||||
@@ -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) {
|
||||
// If still not finished with earlier print request simply ignore.
|
||||
if (prep_frame_view_)
|
||||
return;
|
||||
@@ -1813,7 +1821,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -1861,7 +1869,7 @@ void PrintRenderFrameHelper::Print(
|
||||
FrameReference frame_ref(frame);
|
||||
|
||||
int expected_page_count = 0;
|
||||
uint32_t expected_page_count = 0;
|
||||
- if (!CalculateNumberOfPages(frame, node, &expected_page_count)) {
|
||||
+ if (!CalculateNumberOfPages(frame, node, &expected_page_count, base::Value::AsDictionaryValue(settings))) {
|
||||
DidFinishPrinting(FAIL_PRINT_INIT);
|
||||
return; // Failed to init print page settings.
|
||||
}
|
||||
@@ -1833,8 +1841,11 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -1880,10 +1888,41 @@ void PrintRenderFrameHelper::Print(
|
||||
print_pages_params_->params->print_scaling_option;
|
||||
|
||||
PrintMsg_PrintPages_Params print_settings;
|
||||
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);
|
||||
+ if (silent)
|
||||
+ print_settings = *print_pages_params_.get();
|
||||
+ else
|
||||
+ print_settings.params = mojom::PrintParams::New(
|
||||
+ print_pages_params_->params->page_size,
|
||||
+ print_pages_params_->params->content_size,
|
||||
+ print_pages_params_->params->printable_area,
|
||||
+ print_pages_params_->params->margin_top,
|
||||
+ print_pages_params_->params->margin_left,
|
||||
+ print_pages_params_->params->page_orientation,
|
||||
+ print_pages_params_->params->dpi,
|
||||
+ print_pages_params_->params->scale_factor,
|
||||
+ print_pages_params_->params->document_cookie,
|
||||
+ print_pages_params_->params->selection_only,
|
||||
+ print_pages_params_->params->supports_alpha_blend,
|
||||
+ print_pages_params_->params->preview_ui_id,
|
||||
+ print_pages_params_->params->preview_request_id,
|
||||
+ print_pages_params_->params->is_first_request,
|
||||
+ print_pages_params_->params->print_scaling_option,
|
||||
+ print_pages_params_->params->print_to_pdf,
|
||||
+ print_pages_params_->params->display_header_footer,
|
||||
+ print_pages_params_->params->title,
|
||||
+ print_pages_params_->params->url,
|
||||
+ print_pages_params_->params->header_template,
|
||||
+ print_pages_params_->params->footer_template,
|
||||
+ print_pages_params_->params->rasterize_pdf,
|
||||
+ print_pages_params_->params->should_print_backgrounds,
|
||||
+ print_pages_params_->params->printed_doc_type,
|
||||
+ print_pages_params_->params->prefer_css_page_size,
|
||||
+ print_pages_params_->params->pages_per_sheet);
|
||||
+ else {
|
||||
+ print_settings.params = mojom::PrintParams::New();
|
||||
+ GetPrintSettingsFromUser(frame_ref.GetFrame(), node, expected_page_count,
|
||||
+ print_request_type, &print_settings);
|
||||
+ }
|
||||
// Check if |this| is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -2075,10 +2086,23 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
@@ -2130,11 +2169,24 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
base::ThreadTaskRunnerHandle::Get()->DeleteSoon(FROM_HERE, this);
|
||||
}
|
||||
|
||||
|
@ -555,13 +582,14 @@ index 788257825daa531d2f878c4ee53272dd265dc8aa..e25c8cb1be55df8ae3af62a5738fc381
|
|||
+bool PrintRenderFrameHelper::InitPrintSettings(
|
||||
+ bool fit_to_paper_size,
|
||||
+ const base::DictionaryValue& new_settings) {
|
||||
PrintMsg_PrintPages_Params settings;
|
||||
mojom::PrintPagesParams settings;
|
||||
settings.params = mojom::PrintParams::New();
|
||||
- Send(new PrintHostMsg_GetDefaultPrintSettings(routing_id(),
|
||||
- &settings.params));
|
||||
- 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));
|
||||
+ settings.params.get()));
|
||||
+ } else {
|
||||
+ // Send the update IPC message if caller is webContents.print()
|
||||
+ bool canceled = false;
|
||||
|
@ -574,30 +602,30 @@ index 788257825daa531d2f878c4ee53272dd265dc8aa..e25c8cb1be55df8ae3af62a5738fc381
|
|||
// 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.
|
||||
@@ -2098,12 +2122,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
|
||||
@@ -2154,12 +2206,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
|
||||
return result;
|
||||
}
|
||||
|
||||
-bool PrintRenderFrameHelper::CalculateNumberOfPages(blink::WebLocalFrame* frame,
|
||||
- const blink::WebNode& node,
|
||||
- int* number_of_pages) {
|
||||
- uint32_t* number_of_pages) {
|
||||
+bool PrintRenderFrameHelper::CalculateNumberOfPages(
|
||||
+ blink::WebLocalFrame* frame,
|
||||
+ const blink::WebNode& node,
|
||||
+ int* number_of_pages,
|
||||
+ uint32_t* number_of_pages,
|
||||
+ const base::DictionaryValue& settings) {
|
||||
DCHECK(frame);
|
||||
bool fit_to_paper_size = !IsPrintingNodeOrPdfFrame(frame, node);
|
||||
- if (!InitPrintSettings(fit_to_paper_size)) {
|
||||
+ if (!InitPrintSettings(fit_to_paper_size, settings)) {
|
||||
notify_browser_of_print_failure_ = false;
|
||||
Send(new PrintHostMsg_ShowInvalidPrinterSettingsError(routing_id()));
|
||||
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 b5ec1df59c37ac18c64abe58955e676f546b3da8..6323915537c22bce36c3289fd51d73946bd72d61 100644
|
||||
index 00393383967e0c542edbd7ef2798ef6ddd6c6291..f06149f97b5a91b7e2c3d1aa5d80d46283e8a882 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.h
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.h
|
||||
@@ -226,7 +226,7 @@ class PrintRenderFrameHelper
|
||||
@@ -231,7 +231,7 @@ class PrintRenderFrameHelper
|
||||
mojo::PendingAssociatedReceiver<mojom::PrintRenderFrame> receiver);
|
||||
|
||||
// printing::mojom::PrintRenderFrame:
|
||||
|
@ -606,18 +634,16 @@ index b5ec1df59c37ac18c64abe58955e676f546b3da8..6323915537c22bce36c3289fd51d7394
|
|||
void PrintForSystemDialog() override;
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
void SetPrintPreviewUI(
|
||||
@@ -293,7 +293,9 @@ class PrintRenderFrameHelper
|
||||
// WARNING: |this| may be gone after this method returns.
|
||||
@@ -299,6 +299,8 @@ class PrintRenderFrameHelper
|
||||
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);
|
||||
+ base::Value settings,
|
||||
std::unique_ptr<blink::WebScopedPagePauser> pauser);
|
||||
|
||||
// Notification when printing is done - signal tear-down/free resources.
|
||||
void DidFinishPrinting(PrintingResult result);
|
||||
@@ -302,12 +304,14 @@ class PrintRenderFrameHelper
|
||||
@@ -308,12 +310,14 @@ class PrintRenderFrameHelper
|
||||
|
||||
// Initialize print page settings with default settings.
|
||||
// Used only for native printing workflow.
|
||||
|
@ -628,30 +654,29 @@ index b5ec1df59c37ac18c64abe58955e676f546b3da8..6323915537c22bce36c3289fd51d7394
|
|||
// Calculate number of pages in source document.
|
||||
bool CalculateNumberOfPages(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
- int* number_of_pages);
|
||||
+ int* number_of_pages,
|
||||
- uint32_t* number_of_pages);
|
||||
+ uint32_t* number_of_pages,
|
||||
+ const base::DictionaryValue& settings);
|
||||
|
||||
#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 83e845e8093db6569d77255442c315920803b033..e7505757f2ea1fb8cef0b493336976768ff910d1 100644
|
||||
index 14ec2b673afe6fc0ecfce8028a432f5bcfc9e104..5a1853c4f8e70143e9b1be3dcab7f1dff448346d 100644
|
||||
--- a/printing/printing_context.cc
|
||||
+++ b/printing/printing_context.cc
|
||||
@@ -94,8 +94,6 @@ PrintingContext::Result PrintingContext::UsePdfSettings() {
|
||||
@@ -95,7 +95,6 @@ PrintingContext::Result PrintingContext::UsePdfSettings() {
|
||||
|
||||
PrintingContext::Result PrintingContext::UpdatePrintSettings(
|
||||
base::Value job_settings) {
|
||||
- ResetSettings();
|
||||
-
|
||||
if (!PrintSettingsFromJobSettings(job_settings, settings_.get())) {
|
||||
NOTREACHED();
|
||||
return OnError();
|
||||
{
|
||||
std::unique_ptr<PrintSettings> settings =
|
||||
PrintSettingsFromJobSettings(job_settings);
|
||||
diff --git a/printing/printing_context.h b/printing/printing_context.h
|
||||
index 02144650a9ede47c69fd363a3f275166774aa3de..130d6e433925c509eb9728e99de3b53fee97b95c 100644
|
||||
index 7ac9ce996ca7cbf8bcd21cb0c8161b63050ff684..43f5383bfed965c3d8cd3102dc18309a65c457ae 100644
|
||||
--- a/printing/printing_context.h
|
||||
+++ b/printing/printing_context.h
|
||||
@@ -132,12 +132,12 @@ class PRINTING_EXPORT PrintingContext {
|
||||
@@ -133,12 +133,12 @@ class PRINTING_EXPORT PrintingContext {
|
||||
|
||||
int job_id() const { return job_id_; }
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue