Bug 1156742 Part 15: Add pref for turning on printing via the parent process. r=mconley

This commit is contained in:
Bob Owen 2016-01-05 10:08:57 +00:00
parent e6d63b6d09
commit ab7c01146e
3 changed files with 13 additions and 3 deletions

View File

@ -75,6 +75,7 @@ static const char kPrintingPromptService[] = "@mozilla.org/embedcomp/printingpro
#include "nsISelectionController.h"
// Misc
#include "mozilla/gfx/DrawEventRecorder.h"
#include "mozilla/layout/RemotePrintJobChild.h"
#include "nsISupportsUtils.h"
#include "nsIScriptContext.h"
@ -91,6 +92,7 @@ static const char kPrintingPromptService[] = "@mozilla.org/embedcomp/printingpro
#include "nsWidgetsCID.h"
#include "nsIDeviceContextSpec.h"
#include "nsDeviceContextSpecProxy.h"
#include "nsViewManager.h"
#include "nsView.h"
#include "nsRenderingContext.h"
@ -569,9 +571,13 @@ nsPrintEngine::DoCommonPrint(bool aIsPrintPreview,
mPrt->mPrintSettings->SetPrintOptions(nsIPrintSettings::kEnableSelectionRB,
isSelection || mPrt->mIsIFrameSelected);
nsCOMPtr<nsIDeviceContextSpec> devspec
(do_CreateInstance("@mozilla.org/gfx/devicecontextspec;1", &rv));
nsCOMPtr<nsIDeviceContextSpec> devspec;
if (XRE_IsContentProcess() && Preferences::GetBool("print.print_via_parent")) {
devspec = new nsDeviceContextSpecProxy();
} else {
devspec = do_CreateInstance("@mozilla.org/gfx/devicecontextspec;1", &rv);
NS_ENSURE_SUCCESS(rv, rv);
}
nsScriptSuppressor scriptSuppressor(this);
if (!aIsPrintPreview) {

View File

@ -1004,6 +1004,9 @@ 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.
pref("print.print_via_parent", false);
// Pref used by the spellchecker extension to control the
// maximum number of misspelled words that will be underlined
// in a document.

View File

@ -95,6 +95,7 @@ EXPORTS += [
'InputData.h',
'nsBaseScreen.h',
'nsBaseWidget.h',
'nsDeviceContextSpecProxy.h',
'nsIDeviceContextSpec.h',
'nsIPluginWidget.h',
'nsIRollupListener.h',