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

This commit is contained in:
Bob Owen 2015-12-21 20:33:14 +00:00
parent 14c806bb15
commit c5e5f4a1cd
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));
NS_ENSURE_SUCCESS(rv, 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

@ -1011,6 +1011,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',