Commit fa90c93e authored by Emilio Cobos Álvarez's avatar Emilio Cobos Álvarez
Browse files

Bug 1471854 - Make print.always_print_silent a static pref. r=jwatt, a=RyanVM

So that it shows up in about:config (and also it's faster that way).

Differential Revision: https://phabricator.services.mozilla.com/D79117
parent e6037c60
......@@ -17,6 +17,7 @@
#include "mozilla/dom/Selection.h"
#include "mozilla/dom/CustomEvent.h"
#include "mozilla/dom/ScriptSettings.h"
#include "mozilla/StaticPrefs_print.h"
#include "mozilla/Telemetry.h"
#include "nsIBrowserChild.h"
#include "nsIOService.h"
......@@ -826,12 +827,11 @@ nsresult nsPrintJob::DoCommonPrint(bool aIsPrintPreview,
// driver from the child, which causes sandboxing issues.
if (!aIsPrintPreview || printingViaParent) {
scriptSuppressor.Suppress();
bool printSilently;
bool printSilently = false;
printData->mPrintSettings->GetPrintSilent(&printSilently);
// Check prefs for a default setting as to whether we should print silently
printSilently =
Preferences::GetBool("print.always_print_silent", printSilently);
if (StaticPrefs::print_always_print_silent()) {
printSilently = true;
}
// Ask dialog to be Print Shown via the Plugable Printing Dialog Service
// This service is for the Print Dialog and the Print Progress Dialog
......
......@@ -8118,6 +8118,12 @@
value: true
mirror: always
# Whether we always print silently (without a print dialog).
- name: print.always_print_silent
type: RelaxedAtomicBool
value: false
mirror: always
#---------------------------------------------------------------------------
# Prefs starting with "privacy."
#---------------------------------------------------------------------------
......
......@@ -18,6 +18,7 @@
#include "PrintProgressDialogParent.h"
#include "PrintSettingsDialogParent.h"
#include "mozilla/layout/RemotePrintJobParent.h"
#include "mozilla/StaticPrefs_print.h"
using namespace mozilla;
using namespace mozilla::dom;
......@@ -142,7 +143,7 @@ nsresult PrintingParent::ShowPrintDialog(PBrowserParent* aParent,
// If this is for print preview or we are printing silently then we just need
// to initialize the print settings with anything specific from the printer.
if (isPrintPreview || printSilently ||
Preferences::GetBool("print.always_print_silent", printSilently)) {
StaticPrefs::print_always_print_silent()) {
settings->SetIsInitializedFromPrinter(false);
mPrintSettingsSvc->InitPrintSettingsFromPrinter(printerName, settings);
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment