Bug 1712130 - Make print.print_via_parent a static pref. r=layout-reviewers,jfkthame

Differential Revision: https://phabricator.services.mozilla.com/D115612
This commit is contained in:
Emilio Cobos Álvarez 2021-05-20 17:05:33 +00:00
parent 66d429e573
commit d455c7de64
5 changed files with 10 additions and 12 deletions

View File

@ -613,7 +613,7 @@ nsresult nsPrintJob::DoCommonPrint(bool aIsPrintPreview,
!mDisallowSelectionPrint && printData->mSelectionRoot);
bool printingViaParent =
XRE_IsContentProcess() && Preferences::GetBool("print.print_via_parent");
XRE_IsContentProcess() && StaticPrefs::print_print_via_parent();
nsCOMPtr<nsIDeviceContextSpec> devspec;
if (printingViaParent) {
devspec = new nsDeviceContextSpecProxy();

View File

@ -9831,6 +9831,12 @@
value: true
mirror: always
# Print via the parent process. This is only used when e10s is enabled.
- name: print.print_via_parent
type: RelaxedAtomicBool
value: @IS_NOT_ANDROID@
mirror: always
# Whether we allow the print progress dialog to show up.
- name: print.show_print_progress
type: RelaxedAtomicBool

View File

@ -975,13 +975,6 @@ pref("print.print_edge_left", 0);
pref("print.print_edge_right", 0);
pref("print.print_edge_bottom", 0);
// Print via the parent process. This is only used when e10s is enabled.
#if !defined(MOZ_WIDGET_ANDROID)
pref("print.print_via_parent", true);
#else
pref("print.print_via_parent", false);
#endif
// Should this just be checking for MOZ_WIDGET_GTK?
#if defined(ANDROID) || defined(XP_UNIX) && !defined(XP_MACOSX)
pref("print.print_reversed", false);

View File

@ -23,6 +23,7 @@
#include "nsIStringEnumerator.h"
#include "stdlib.h"
#include "mozilla/StaticPrefs_print.h"
#include "mozilla/Preferences.h"
#include "nsPrintfCString.h"
@ -767,8 +768,7 @@ nsPrintSettingsService::InitPrintSettingsFromPrinter(
const nsAString& aPrinterName, nsIPrintSettings* aPrintSettings) {
// Don't get print settings from the printer in the child when printing via
// parent, these will be retrieved in the parent later in the print process.
if (XRE_IsContentProcess() &&
Preferences::GetBool("print.print_via_parent")) {
if (XRE_IsContentProcess() && StaticPrefs::print_print_via_parent()) {
return NS_OK;
}

View File

@ -180,8 +180,7 @@ NS_IMETHODIMP nsDeviceContextSpecWin::Init(nsIWidget* aWidget,
// If we're in the child and printing via the parent or we're printing to
// PDF we only need information from the print settings.
if ((XRE_IsContentProcess() &&
Preferences::GetBool("print.print_via_parent")) ||
if ((XRE_IsContentProcess() && StaticPrefs::print_print_via_parent()) ||
mOutputFormat == nsIPrintSettings::kOutputFormatPDF) {
return NS_OK;
}