chore: bump chromium to 96.0.4664.4 (main) (#31317)
* chore: bump chromium in DEPS to 96.0.4662.0 * chore: bump chromium in DEPS to 96.0.4663.0 * chore: update patches * [Extensions] Remove RuntimeData entirely3177328
* Make helper macros behave consistently for //content/public UserData types3198788
* Enabling sandboxing for the speech recognition service browser tests3146090
* [devtools] Add 'RegisterPreference' host binding3162281
* [Reland][Extensions]: Add persistAcrossSessions flag (scripting API)3175161
* [Bluetooth] Add Passkey prompt dialog for bonding.2841104
* Clipboard: Remove ReadImage path in browser3194826
* Split printing metafile code into its own target.3164925
* Cleanup unused DesktopMediaListObserver params3179203
* Remove base::DictionaryValue::GetBinary3201974
* Window Placement: change RWHV::GetDisplayList to GetScreenInfos3138774
* Add a preview to the Tab Capture picker dialog3045268
* Add service-based usage to update print settings3155426
* chore: bump chromium in DEPS to 96.0.4664.2 * chore: update patches * chore: bump chromium in DEPS to 96.0.4664.4 * chore: update patches * chore: bump chromium in DEPS to 97.0.4666.0 * Revert "chore: bump chromium in DEPS to 97.0.4666.0" This reverts commit d73caae8ba4b39efc9b3ea4de52685b9c92ef3d0. * Reland "Block external protocol handler with sandbox."3198263
* fixup for lint * Add CookiePartitionKeychain parameter to CookeManager.GetCookieList.3206016
* Move ui/gfx/transform*,rrect*,mask_filter_info* into ui/gfx/geometry3200392
* fixup Move ui/gfx/transform*,rrect*,mask_filter_info* into ui/gfx/geometry * ozone: //chrome/browser clean up from USE_X113186490
* content: don't load v8 snapshot in browser process3183394
* [devtools] Add 'RegisterPreference' host binding3162281
* 3186491: Add 'devtools.sync_preferences' preference3186491
* 2951147: DCHECK accessible names for focusable Views2951147
* 3201014: Use real font size for calculation of SmallTextRatio3201014
* fixup Clipboard: Remove ReadImage path in browser * chore: update patches * fix: disable PlzServiceWorker to fix custom protocol SW script loading Ref:3199761
Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@electronjs.org> Co-authored-by: PatchUp <73610968+patchup[bot]@users.noreply.github.com> Co-authored-by: John Kleinschmidt <jkleinsc@github.com> Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com> Co-authored-by: Samuel Attard <samuel.r.attard@gmail.com>
This commit is contained in:
parent
ed2aaed4bd
commit
87f7625c5d
122 changed files with 806 additions and 2905 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 5e44b586937c4100e9cb55f152338a11f24eed8c..879add3dc328cea225b9f4c91bd103939429beeb 100644
|
||||
index baf39affec92126a6f998636bf35d1f2563fa47f..18c61ff4b2145881fd396b6e397eb7c4f9468558 100644
|
||||
--- a/chrome/browser/printing/print_job.cc
|
||||
+++ b/chrome/browser/printing/print_job.cc
|
||||
@@ -89,6 +89,7 @@ bool PrintWithReducedRasterization(PrefService* prefs) {
|
||||
@@ -88,6 +88,7 @@ bool PrintWithReducedRasterization(PrefService* prefs) {
|
||||
return base::FeatureList::IsEnabled(features::kPrintWithReducedRasterization);
|
||||
}
|
||||
|
||||
|
@ -22,7 +22,7 @@ index 5e44b586937c4100e9cb55f152338a11f24eed8c..879add3dc328cea225b9f4c91bd10393
|
|||
PrefService* GetPrefsForWebContents(content::WebContents* web_contents) {
|
||||
// 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
|
||||
@@ -97,6 +98,7 @@ PrefService* GetPrefsForWebContents(content::WebContents* web_contents) {
|
||||
@@ -96,6 +97,7 @@ PrefService* GetPrefsForWebContents(content::WebContents* web_contents) {
|
||||
web_contents ? web_contents->GetBrowserContext() : nullptr;
|
||||
return context ? Profile::FromBrowserContext(context)->GetPrefs() : nullptr;
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ index 5e44b586937c4100e9cb55f152338a11f24eed8c..879add3dc328cea225b9f4c91bd10393
|
|||
|
||||
#endif // defined(OS_WIN)
|
||||
|
||||
@@ -381,11 +383,18 @@ void PrintJob::StartPdfToEmfConversion(
|
||||
@@ -380,11 +382,18 @@ void PrintJob::StartPdfToEmfConversion(
|
||||
// seems to work with the fix for this bug applied.
|
||||
const PrintSettings& settings = document()->settings();
|
||||
bool print_text_with_gdi =
|
||||
|
@ -51,7 +51,7 @@ index 5e44b586937c4100e9cb55f152338a11f24eed8c..879add3dc328cea225b9f4c91bd10393
|
|||
|
||||
using RenderMode = PdfRenderSettings::Mode;
|
||||
RenderMode mode;
|
||||
@@ -480,8 +489,10 @@ void PrintJob::StartPdfToPostScriptConversion(
|
||||
@@ -479,8 +488,10 @@ void PrintJob::StartPdfToPostScriptConversion(
|
||||
if (ps_level2) {
|
||||
mode = PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2;
|
||||
} else {
|
||||
|
@ -63,7 +63,7 @@ index 5e44b586937c4100e9cb55f152338a11f24eed8c..879add3dc328cea225b9f4c91bd10393
|
|||
? PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3_WITH_TYPE42_FONTS
|
||||
: PdfRenderSettings::Mode::POSTSCRIPT_LEVEL3;
|
||||
}
|
||||
@@ -531,6 +542,10 @@ void PrintJob::OnNotifyPrintJobEvent(const JobEventDetails& event_details) {
|
||||
@@ -530,6 +541,10 @@ void PrintJob::OnNotifyPrintJobEvent(const JobEventDetails& event_details) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
|
||||
switch (event_details.type()) {
|
||||
|
@ -75,10 +75,10 @@ index 5e44b586937c4100e9cb55f152338a11f24eed8c..879add3dc328cea225b9f4c91bd10393
|
|||
// No need to cancel since the worker already canceled itself.
|
||||
Stop();
|
||||
diff --git a/chrome/browser/printing/print_job.h b/chrome/browser/printing/print_job.h
|
||||
index b8b83529be4c7da661032d3b941984c02b978047..98ef6cfad5dc46d9dcb65a0ce506db3729410239 100644
|
||||
index 5914354ac77532eadb26bd09cffc8470fcf41c4b..18a92f5a9a35b7a86f47f6555b37d3c729c468cd 100644
|
||||
--- a/chrome/browser/printing/print_job.h
|
||||
+++ b/chrome/browser/printing/print_job.h
|
||||
@@ -242,6 +242,9 @@ class JobEventDetails : public base::RefCountedThreadSafe<JobEventDetails> {
|
||||
@@ -243,6 +243,9 @@ class JobEventDetails : public base::RefCountedThreadSafe<JobEventDetails> {
|
||||
public:
|
||||
// Event type.
|
||||
enum Type {
|
||||
|
@ -89,7 +89,7 @@ index b8b83529be4c7da661032d3b941984c02b978047..98ef6cfad5dc46d9dcb65a0ce506db37
|
|||
NEW_DOC,
|
||||
|
||||
diff --git a/chrome/browser/printing/print_job_worker.cc b/chrome/browser/printing/print_job_worker.cc
|
||||
index 4305943435c15275084f0a9bb5490831d893870f..a048c0c11b3a8a06401ddf4d6e15700bf05600c3 100644
|
||||
index 288b9f89129de88ea078b2e6d3b2d255dd527a95..e9979d5c9707e94580d4a10b4c48c32ce07cfc70 100644
|
||||
--- a/chrome/browser/printing/print_job_worker.cc
|
||||
+++ b/chrome/browser/printing/print_job_worker.cc
|
||||
@@ -21,13 +21,13 @@
|
||||
|
@ -105,13 +105,13 @@ index 4305943435c15275084f0a9bb5490831d893870f..a048c0c11b3a8a06401ddf4d6e15700b
|
|||
#include "content/public/browser/web_contents.h"
|
||||
+#include "electron/grit/electron_resources.h"
|
||||
#include "printing/backend/print_backend.h"
|
||||
#include "printing/buildflags/buildflags.h"
|
||||
#include "printing/mojom/print.mojom.h"
|
||||
#include "printing/print_job_constants.h"
|
||||
@@ -240,16 +240,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
|
||||
@@ -301,16 +301,21 @@ void PrintJobWorker::UpdatePrintSettings(base::Value new_settings,
|
||||
#endif // defined(OS_LINUX) && defined(USE_CUPS)
|
||||
}
|
||||
|
||||
- PrintingContext::Result result;
|
||||
- mojom::ResultCode result;
|
||||
{
|
||||
#if defined(OS_WIN)
|
||||
// Blocking is needed here because Windows printer drivers are oftentimes
|
||||
|
@ -121,9 +121,9 @@ index 4305943435c15275084f0a9bb5490831d893870f..a048c0c11b3a8a06401ddf4d6e15700b
|
|||
- result = printing_context_->UpdatePrintSettings(std::move(new_settings));
|
||||
+ // Reset settings from previous print job
|
||||
+ printing_context_->ResetSettings();
|
||||
+ PrintingContext::Result get_default_result = printing_context_->UseDefaultSettings();
|
||||
+ if (get_default_result == PrintingContext::Result::OK) {
|
||||
+ PrintingContext::Result update_result =
|
||||
+ mojom::ResultCode get_default_result = printing_context_->UseDefaultSettings();
|
||||
+ if (get_default_result == mojom::ResultCode::kSuccess) {
|
||||
+ mojom::ResultCode update_result =
|
||||
+ printing_context_->UpdatePrintSettings(std::move(new_settings));
|
||||
+ GetSettingsDone(std::move(callback), update_result);
|
||||
+ }
|
||||
|
@ -132,11 +132,11 @@ index 4305943435c15275084f0a9bb5490831d893870f..a048c0c11b3a8a06401ddf4d6e15700b
|
|||
}
|
||||
|
||||
#if defined(OS_CHROMEOS)
|
||||
@@ -265,6 +270,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
|
||||
@@ -326,6 +331,13 @@ void PrintJobWorker::UpdatePrintSettingsFromPOD(
|
||||
|
||||
void PrintJobWorker::GetSettingsDone(SettingsCallback callback,
|
||||
PrintingContext::Result result) {
|
||||
+ if (result == PrintingContext::CANCEL) {
|
||||
mojom::ResultCode result) {
|
||||
+ if (result == mojom::ResultCode::kCanceled) {
|
||||
+ print_job_->PostTask(
|
||||
+ FROM_HERE,
|
||||
+ base::BindOnce(&NotificationCallback, base::RetainedRef(print_job_),
|
||||
|
@ -147,7 +147,7 @@ index 4305943435c15275084f0a9bb5490831d893870f..a048c0c11b3a8a06401ddf4d6e15700b
|
|||
}
|
||||
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.cc b/chrome/browser/printing/print_view_manager_base.cc
|
||||
index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f4a33a433 100644
|
||||
index 2011d52338081666b4761e0bf66d01245abd0213..647ac4cd9730c8983868ea165907b7c9a42767aa 100644
|
||||
--- a/chrome/browser/printing/print_view_manager_base.cc
|
||||
+++ b/chrome/browser/printing/print_view_manager_base.cc
|
||||
@@ -28,10 +28,10 @@
|
||||
|
@ -188,18 +188,18 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
|||
}
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
@@ -237,7 +241,9 @@ void UpdatePrintSettingsReplyOnIO(
|
||||
@@ -238,7 +242,9 @@ void UpdatePrintSettingsReplyOnIO(
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
|
||||
DCHECK(printer_query);
|
||||
mojom::PrintPagesParamsPtr params = CreateEmptyPrintPagesParamsPtr();
|
||||
- if (printer_query->last_status() == PrintingContext::OK) {
|
||||
- if (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();
|
||||
@@ -340,12 +346,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
|
||||
@@ -341,12 +347,14 @@ PrintViewManagerBase::PrintViewManagerBase(content::WebContents* web_contents)
|
||||
: PrintManager(web_contents),
|
||||
queue_(g_browser_process->print_job_manager()->queue()) {
|
||||
DCHECK(queue_);
|
||||
|
@ -214,7 +214,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
|||
}
|
||||
|
||||
PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
@@ -353,7 +361,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
@@ -354,7 +362,10 @@ PrintViewManagerBase::~PrintViewManagerBase() {
|
||||
DisconnectFromCurrentPrintJob();
|
||||
}
|
||||
|
||||
|
@ -226,7 +226,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
|||
auto weak_this = weak_ptr_factory_.GetWeakPtr();
|
||||
DisconnectFromCurrentPrintJob();
|
||||
if (!weak_this)
|
||||
@@ -368,7 +379,14 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
|
||||
@@ -369,7 +380,14 @@ bool PrintViewManagerBase::PrintNow(content::RenderFrameHost* rfh) {
|
||||
// go in `ReleasePrintJob()`.
|
||||
|
||||
SetPrintingRFH(rfh);
|
||||
|
@ -239,10 +239,10 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
|||
+ }
|
||||
+
|
||||
+ GetPrintRenderFrame(rfh)->PrintRequestedPages(silent, std::move(settings));
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -523,9 +541,9 @@ void PrintViewManagerBase::ScriptedPrintReply(
|
||||
for (auto& observer : GetObservers())
|
||||
observer.OnPrintNow(rfh);
|
||||
@@ -528,9 +546,9 @@ void PrintViewManagerBase::ScriptedPrintReply(
|
||||
void PrintViewManagerBase::UpdatePrintingEnabled() {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
// The Unretained() is safe because ForEachFrame() is synchronous.
|
||||
|
@ -255,7 +255,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
|||
}
|
||||
|
||||
void PrintViewManagerBase::NavigationStopped() {
|
||||
@@ -639,12 +657,13 @@ void PrintViewManagerBase::DidPrintDocument(
|
||||
@@ -644,12 +662,13 @@ void PrintViewManagerBase::DidPrintDocument(
|
||||
void PrintViewManagerBase::GetDefaultPrintSettings(
|
||||
GetDefaultPrintSettingsCallback callback) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
|
@ -270,7 +270,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
|||
content::RenderFrameHost* render_frame_host = GetCurrentTargetFrame();
|
||||
auto callback_wrapper =
|
||||
base::BindOnce(&PrintViewManagerBase::GetDefaultPrintSettingsReply,
|
||||
@@ -662,18 +681,20 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
@@ -667,18 +686,20 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
base::Value job_settings,
|
||||
UpdatePrintSettingsCallback callback) {
|
||||
DCHECK_CURRENTLY_ON(content::BrowserThread::UI);
|
||||
|
@ -292,7 +292,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
|||
content::BrowserContext* context =
|
||||
web_contents() ? web_contents()->GetBrowserContext() : nullptr;
|
||||
PrefService* prefs =
|
||||
@@ -683,6 +704,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
@@ -688,6 +709,7 @@ void PrintViewManagerBase::UpdatePrintSettings(
|
||||
if (value > 0)
|
||||
job_settings.SetIntKey(kSettingRasterizePdfDpi, value);
|
||||
}
|
||||
|
@ -300,7 +300,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
|||
|
||||
content::RenderFrameHost* render_frame_host = GetCurrentTargetFrame();
|
||||
auto callback_wrapper =
|
||||
@@ -722,13 +744,17 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) {
|
||||
@@ -727,7 +749,6 @@ void PrintViewManagerBase::PrintingFailed(int32_t cookie) {
|
||||
PrintManager::PrintingFailed(cookie);
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
|
@ -308,6 +308,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
|||
#endif
|
||||
|
||||
ReleasePrinterQuery();
|
||||
@@ -742,6 +763,11 @@ void PrintViewManagerBase::RemoveObserver(Observer& observer) {
|
||||
}
|
||||
|
||||
void PrintViewManagerBase::ShowInvalidPrinterSettingsError() {
|
||||
|
@ -319,7 +320,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
|||
base::ThreadTaskRunnerHandle::Get()->PostTask(
|
||||
FROM_HERE, base::BindOnce(&ShowWarningMessageBox,
|
||||
l10n_util::GetStringUTF16(
|
||||
@@ -807,6 +833,11 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
|
||||
@@ -820,6 +846,11 @@ void PrintViewManagerBase::OnNotifyPrintJobEvent(
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
@ -331,7 +332,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
|||
case JobEventDetails::JOB_DONE:
|
||||
// Printing is done, we don't need it anymore.
|
||||
// print_job_->is_job_pending() may still be true, depending on the order
|
||||
@@ -876,7 +907,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
@@ -889,7 +920,10 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
|
||||
// Disconnect the current |print_job_|.
|
||||
auto weak_this = weak_ptr_factory_.GetWeakPtr();
|
||||
|
@ -343,7 +344,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
|||
if (!weak_this)
|
||||
return false;
|
||||
|
||||
@@ -899,8 +933,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
@@ -912,8 +946,6 @@ bool PrintViewManagerBase::CreateNewPrintJob(
|
||||
/*source_id=*/"");
|
||||
#endif
|
||||
|
||||
|
@ -352,7 +353,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
|||
printing_succeeded_ = false;
|
||||
return true;
|
||||
}
|
||||
@@ -952,14 +984,22 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
@@ -965,14 +997,22 @@ void PrintViewManagerBase::ReleasePrintJob() {
|
||||
content::RenderFrameHost* rfh = printing_rfh_;
|
||||
printing_rfh_ = nullptr;
|
||||
|
||||
|
@ -377,7 +378,7 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
|||
// Don't close the worker thread.
|
||||
print_job_ = nullptr;
|
||||
}
|
||||
@@ -998,7 +1038,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||
@@ -1010,7 +1050,7 @@ bool PrintViewManagerBase::RunInnerMessageLoop() {
|
||||
}
|
||||
|
||||
bool PrintViewManagerBase::OpportunisticallyCreatePrintJob(int cookie) {
|
||||
|
@ -387,10 +388,10 @@ index e4cacbf9a82da8dca062cc33df885a0575e74830..143ee383668965ba04da092e3445fc9f
|
|||
|
||||
if (!cookie) {
|
||||
diff --git a/chrome/browser/printing/print_view_manager_base.h b/chrome/browser/printing/print_view_manager_base.h
|
||||
index 24ffeb0a87b2e324f84260eb4ec65021998ee2c3..872008c7ffd5298dc3cc8d1b52be6113104ce49c 100644
|
||||
index c4bcf96d0ac0130a74a9b5400546dfdf335dbd68..eb946b1f599629f663b79d11039e853a5b013d29 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;
|
||||
@@ -40,6 +40,8 @@ class PrintJob;
|
||||
class PrintQueriesQueue;
|
||||
class PrinterQuery;
|
||||
|
||||
|
@ -399,7 +400,7 @@ index 24ffeb0a87b2e324f84260eb4ec65021998ee2c3..872008c7ffd5298dc3cc8d1b52be6113
|
|||
// Base class for managing the print commands for a WebContents.
|
||||
class PrintViewManagerBase : public content::NotificationObserver,
|
||||
public PrintManager {
|
||||
@@ -50,7 +52,10 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
||||
@@ -62,7 +64,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.
|
||||
|
@ -411,7 +412,7 @@ index 24ffeb0a87b2e324f84260eb4ec65021998ee2c3..872008c7ffd5298dc3cc8d1b52be6113
|
|||
|
||||
#if BUILDFLAG(ENABLE_PRINT_PREVIEW)
|
||||
// Prints the document in |print_data| with settings specified in
|
||||
@@ -237,9 +242,15 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
||||
@@ -257,9 +262,15 @@ class PrintViewManagerBase : public content::NotificationObserver,
|
||||
// The current RFH that is printing with a system printing dialog.
|
||||
content::RenderFrameHost* printing_rfh_ = nullptr;
|
||||
|
||||
|
@ -441,7 +442,7 @@ index 51ebcb4ae399018d3fd8566656596a7ef1f148af..5f2b807fc364131f4c3e6a1646ec522d
|
|||
// 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 ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938fbad4cf5f 100644
|
||||
index 2760a694a946eb2e4dba1ee228dc5fc13a2fc98e..769976022186037d8e75e244bdb0450c5670b5c0 100644
|
||||
--- a/components/printing/renderer/print_render_frame_helper.cc
|
||||
+++ b/components/printing/renderer/print_render_frame_helper.cc
|
||||
@@ -38,6 +38,7 @@
|
||||
|
@ -452,7 +453,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
|||
#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"
|
||||
@@ -1221,7 +1222,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
@@ -1222,7 +1223,8 @@ void PrintRenderFrameHelper::ScriptedPrint(bool user_initiated) {
|
||||
if (!weak_this)
|
||||
return;
|
||||
|
||||
|
@ -462,7 +463,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
|||
if (!weak_this)
|
||||
return;
|
||||
|
||||
@@ -1252,7 +1254,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
|
||||
@@ -1253,7 +1255,7 @@ void PrintRenderFrameHelper::BindPrintRenderFrameReceiver(
|
||||
receivers_.Add(this, std::move(receiver));
|
||||
}
|
||||
|
||||
|
@ -471,7 +472,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
|||
ScopedIPC scoped_ipc(weak_ptr_factory_.GetWeakPtr());
|
||||
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
|
||||
return;
|
||||
@@ -1267,7 +1269,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
|
||||
@@ -1268,7 +1270,7 @@ void PrintRenderFrameHelper::PrintRequestedPages() {
|
||||
// that instead.
|
||||
auto plugin = delegate_->GetPdfElement(frame);
|
||||
|
||||
|
@ -480,7 +481,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
|||
|
||||
if (!render_frame_gone_)
|
||||
frame->DispatchAfterPrintEvent();
|
||||
@@ -1298,7 +1300,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
|
||||
@@ -1299,7 +1301,8 @@ void PrintRenderFrameHelper::PrintForSystemDialog() {
|
||||
}
|
||||
|
||||
Print(frame, print_preview_context_.source_node(),
|
||||
|
@ -490,7 +491,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
|||
if (!render_frame_gone_)
|
||||
print_preview_context_.DispatchAfterPrintEvent();
|
||||
// WARNING: |this| may be gone at this point. Do not do any more work here and
|
||||
@@ -1345,6 +1348,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
|
||||
@@ -1346,6 +1349,8 @@ void PrintRenderFrameHelper::PrintPreview(base::Value settings) {
|
||||
if (ipc_nesting_level_ > kAllowedIpcDepthForPrint)
|
||||
return;
|
||||
|
||||
|
@ -499,7 +500,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
|||
print_preview_context_.OnPrintPreview();
|
||||
|
||||
if (print_preview_context_.IsForArc()) {
|
||||
@@ -1881,7 +1886,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -1882,7 +1887,8 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
return;
|
||||
|
||||
Print(duplicate_node.GetDocument().GetFrame(), duplicate_node,
|
||||
|
@ -509,7 +510,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
|||
// Check if |this| is still valid.
|
||||
if (!weak_this)
|
||||
return;
|
||||
@@ -1896,7 +1902,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
@@ -1897,7 +1903,9 @@ void PrintRenderFrameHelper::PrintNode(const blink::WebNode& node) {
|
||||
|
||||
void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
const blink::WebNode& node,
|
||||
|
@ -520,7 +521,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
|||
// If still not finished with earlier print request simply ignore.
|
||||
if (prep_frame_view_)
|
||||
return;
|
||||
@@ -1904,7 +1912,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -1905,7 +1913,7 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
FrameReference frame_ref(frame);
|
||||
|
||||
uint32_t expected_page_count = 0;
|
||||
|
@ -529,7 +530,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
|||
DidFinishPrinting(FAIL_PRINT_INIT);
|
||||
return; // Failed to init print page settings.
|
||||
}
|
||||
@@ -1923,8 +1931,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
@@ -1924,8 +1932,15 @@ void PrintRenderFrameHelper::Print(blink::WebLocalFrame* frame,
|
||||
print_pages_params_->params->print_scaling_option;
|
||||
|
||||
auto self = weak_ptr_factory_.GetWeakPtr();
|
||||
|
@ -546,7 +547,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
|||
// Check if |this| is still valid.
|
||||
if (!self)
|
||||
return;
|
||||
@@ -2172,7 +2187,9 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
@@ -2173,7 +2188,9 @@ void PrintRenderFrameHelper::IPCProcessed() {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -557,7 +558,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
|||
mojom::PrintPagesParams settings;
|
||||
settings.params = mojom::PrintParams::New();
|
||||
GetPrintManagerHost()->GetDefaultPrintSettings(&settings.params);
|
||||
@@ -2196,12 +2213,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
|
||||
@@ -2197,12 +2214,14 @@ bool PrintRenderFrameHelper::InitPrintSettings(bool fit_to_paper_size) {
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -576,7 +577,7 @@ index ed3178671552bd673820f1d078374cf34e704797..4a5ccdadabfdd6eea89b9bb5e726938f
|
|||
notify_browser_of_print_failure_ = false;
|
||||
GetPrintManagerHost()->ShowInvalidPrinterSettingsError();
|
||||
return false;
|
||||
@@ -2572,18 +2591,7 @@ void PrintRenderFrameHelper::RequestPrintPreview(PrintPreviewRequestType type) {
|
||||
@@ -2573,18 +2592,7 @@ void PrintRenderFrameHelper::RequestPrintPreview(PrintPreviewRequestType type) {
|
||||
}
|
||||
|
||||
bool PrintRenderFrameHelper::CheckForCancel() {
|
||||
|
@ -638,22 +639,22 @@ index 90236920457c931c86426049c6cbc30b592b597f..353178863eba37b9112e784ffa4b3519
|
|||
#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 744c3acfb9637aa64785dabd041ee416d56c3e43..9dadda9dfecdcf7826a3766064530a10126df66b 100644
|
||||
index cdfb2e0abd17b95bae4e1fd86aaf7364a76be1f6..446ae2060a27d6fa3d9b2f2691243369ad56f440 100644
|
||||
--- a/printing/printing_context.cc
|
||||
+++ b/printing/printing_context.cc
|
||||
@@ -115,7 +115,6 @@ PrintingContext::Result PrintingContext::UsePdfSettings() {
|
||||
@@ -116,7 +116,6 @@ mojom::ResultCode PrintingContext::UsePdfSettings() {
|
||||
|
||||
PrintingContext::Result PrintingContext::UpdatePrintSettings(
|
||||
mojom::ResultCode PrintingContext::UpdatePrintSettings(
|
||||
base::Value job_settings) {
|
||||
- ResetSettings();
|
||||
{
|
||||
std::unique_ptr<PrintSettings> settings =
|
||||
PrintSettingsFromJobSettings(job_settings);
|
||||
diff --git a/printing/printing_context.h b/printing/printing_context.h
|
||||
index 753bc1d564d607b4be671c3c618e1b60f8e7bb3f..c60136097403e9b5930917433064b57ba5771a3b 100644
|
||||
index b28af89c67f88cc86f4604cd6204ca6231c5908c..cbfeb7234ba26f08ae3cddf6a6dd4014f04c4285 100644
|
||||
--- a/printing/printing_context.h
|
||||
+++ b/printing/printing_context.h
|
||||
@@ -149,6 +149,9 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext {
|
||||
@@ -143,6 +143,9 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext {
|
||||
|
||||
int job_id() const { return job_id_; }
|
||||
|
||||
|
@ -663,7 +664,7 @@ index 753bc1d564d607b4be671c3c618e1b60f8e7bb3f..c60136097403e9b5930917433064b57b
|
|||
protected:
|
||||
explicit PrintingContext(Delegate* delegate);
|
||||
|
||||
@@ -156,9 +159,6 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext {
|
||||
@@ -150,9 +153,6 @@ class COMPONENT_EXPORT(PRINTING) PrintingContext {
|
||||
// implement this method to create an object of their implementation.
|
||||
static std::unique_ptr<PrintingContext> CreateImpl(Delegate* delegate);
|
||||
|
||||
|
@ -671,5 +672,5 @@ index 753bc1d564d607b4be671c3c618e1b60f8e7bb3f..c60136097403e9b5930917433064b57b
|
|||
- void ResetSettings();
|
||||
-
|
||||
// Does bookkeeping when an error occurs.
|
||||
PrintingContext::Result OnError();
|
||||
virtual mojom::ResultCode OnError();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue