зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 8e04b9c921ad (bug 1088070)
This commit is contained in:
Родитель
4c5ee903cd
Коммит
b9d31e6615
|
@ -40,8 +40,7 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsDialogParamBlock)
|
|||
#ifdef NS_PRINTING
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintingPromptService, Init)
|
||||
#ifdef PROXY_PRINTING
|
||||
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsPrintingProxy,
|
||||
nsPrintingProxy::GetInstance)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsPrintingProxy, Init)
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
|
|
@ -102,10 +102,6 @@ parent:
|
|||
|
||||
PPrintProgressDialog();
|
||||
|
||||
sync SavePrintSettings(PrintData settings, bool usePrinterNamePrefix,
|
||||
uint32_t flags)
|
||||
returns(nsresult rv);
|
||||
|
||||
child:
|
||||
__delete__();
|
||||
};
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "nsIPrintingPromptService.h"
|
||||
#include "nsIPrintOptions.h"
|
||||
#include "nsIPrintProgressParams.h"
|
||||
#include "nsIPrintSettingsService.h"
|
||||
#include "nsIServiceManager.h"
|
||||
#include "nsIWebProgressListener.h"
|
||||
#include "PrintingParent.h"
|
||||
|
@ -112,31 +111,6 @@ PrintingParent::RecvShowPrintDialog(PBrowserParent* parent,
|
|||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
PrintingParent::RecvSavePrintSettings(const PrintData& aData,
|
||||
const bool& aUsePrinterNamePrefix,
|
||||
const uint32_t& aFlags,
|
||||
nsresult* aResult)
|
||||
{
|
||||
nsCOMPtr<nsIPrintSettingsService> pss =
|
||||
do_GetService("@mozilla.org/gfx/printsettings-service;1", aResult);
|
||||
NS_ENSURE_SUCCESS(*aResult, true);
|
||||
|
||||
nsCOMPtr<nsIPrintOptions> po = do_QueryInterface(pss, aResult);
|
||||
NS_ENSURE_SUCCESS(*aResult, true);
|
||||
|
||||
nsCOMPtr<nsIPrintSettings> settings;
|
||||
*aResult = po->CreatePrintSettings(getter_AddRefs(settings));
|
||||
NS_ENSURE_SUCCESS(*aResult, true);
|
||||
|
||||
*aResult = po->DeserializeToPrintSettings(aData, settings);
|
||||
NS_ENSURE_SUCCESS(*aResult, true);
|
||||
|
||||
*aResult = pss->SavePrintSettingsToPrefs(settings, aUsePrinterNamePrefix, aFlags);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
PPrintProgressDialogParent*
|
||||
PrintingParent::AllocPPrintProgressDialogParent()
|
||||
{
|
||||
|
|
|
@ -31,12 +31,6 @@ public:
|
|||
PrintData* retVal,
|
||||
bool* success);
|
||||
|
||||
virtual bool
|
||||
RecvSavePrintSettings(const PrintData& aData,
|
||||
const bool& aUsePrinterNamePrefix,
|
||||
const uint32_t& aFlags,
|
||||
nsresult* aResult);
|
||||
|
||||
virtual PPrintProgressDialogParent*
|
||||
AllocPPrintProgressDialogParent();
|
||||
|
||||
|
|
|
@ -4,10 +4,6 @@
|
|||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
EXPORTS += [
|
||||
'nsPrintingProxy.h',
|
||||
]
|
||||
|
||||
EXPORTS.mozilla.embedding.printingui += [
|
||||
'PrintingParent.h',
|
||||
]
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/ClearOnShutdown.h"
|
||||
#include "mozilla/dom/ContentChild.h"
|
||||
#include "mozilla/dom/TabChild.h"
|
||||
#include "mozilla/unused.h"
|
||||
|
@ -21,8 +20,6 @@ using namespace mozilla;
|
|||
using namespace mozilla::dom;
|
||||
using namespace mozilla::embedding;
|
||||
|
||||
static StaticRefPtr<nsPrintingProxy> sPrintingProxyInstance;
|
||||
|
||||
NS_IMPL_ISUPPORTS(nsPrintingProxy, nsIPrintingPromptService)
|
||||
|
||||
nsPrintingProxy::nsPrintingProxy()
|
||||
|
@ -33,27 +30,6 @@ nsPrintingProxy::~nsPrintingProxy()
|
|||
{
|
||||
}
|
||||
|
||||
/* static */
|
||||
already_AddRefed<nsPrintingProxy>
|
||||
nsPrintingProxy::GetInstance()
|
||||
{
|
||||
if (!sPrintingProxyInstance) {
|
||||
sPrintingProxyInstance = new nsPrintingProxy();
|
||||
if (!sPrintingProxyInstance) {
|
||||
return nullptr;
|
||||
}
|
||||
nsresult rv = sPrintingProxyInstance->Init();
|
||||
if (NS_FAILED(rv)) {
|
||||
sPrintingProxyInstance = nullptr;
|
||||
return nullptr;
|
||||
}
|
||||
ClearOnShutdown(&sPrintingProxyInstance);
|
||||
}
|
||||
|
||||
nsRefPtr<nsPrintingProxy> inst = sPrintingProxyInstance.get();
|
||||
return inst.forget();
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsPrintingProxy::Init()
|
||||
{
|
||||
|
@ -168,25 +144,6 @@ nsPrintingProxy::ShowPrinterProperties(nsIDOMWindow *parent,
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
nsresult
|
||||
nsPrintingProxy::SavePrintSettings(nsIPrintSettings* aPS,
|
||||
bool aUsePrinterNamePrefix,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
nsresult rv;
|
||||
nsCOMPtr<nsIPrintOptions> po =
|
||||
do_GetService("@mozilla.org/gfx/printsettings-service;1", &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
PrintData settings;
|
||||
rv = po->SerializeToPrintData(aPS, nullptr, &settings);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
unused << SendSavePrintSettings(settings, aUsePrinterNamePrefix, aFlags,
|
||||
&rv);
|
||||
return rv;
|
||||
}
|
||||
|
||||
PPrintProgressDialogChild*
|
||||
nsPrintingProxy::AllocPPrintProgressDialogChild()
|
||||
{
|
||||
|
|
|
@ -17,17 +17,11 @@ class nsPrintingProxy: public nsIPrintingPromptService,
|
|||
public:
|
||||
nsPrintingProxy();
|
||||
|
||||
static already_AddRefed<nsPrintingProxy> GetInstance();
|
||||
|
||||
nsresult Init();
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIPRINTINGPROMPTSERVICE
|
||||
|
||||
nsresult SavePrintSettings(nsIPrintSettings* aPS,
|
||||
bool aUsePrinterNamePrefix,
|
||||
uint32_t aFlags);
|
||||
|
||||
virtual PPrintProgressDialogChild*
|
||||
AllocPPrintProgressDialogChild() MOZ_OVERRIDE;
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "mozilla/embedding/PPrinting.h"
|
||||
#include "nsPrintingProxy.h"
|
||||
#include "nsPrintOptionsImpl.h"
|
||||
#include "nsReadableUtils.h"
|
||||
#include "nsPrintSettingsImpl.h"
|
||||
|
@ -1298,15 +1297,6 @@ nsPrintOptions::SavePrintSettingsToPrefs(nsIPrintSettings *aPS,
|
|||
uint32_t aFlags)
|
||||
{
|
||||
NS_ENSURE_ARG_POINTER(aPS);
|
||||
|
||||
if (GeckoProcessType_Content == XRE_GetProcessType()) {
|
||||
// If we're in the content process, we can't directly write to the
|
||||
// Preferences service - we have to proxy the save up to the
|
||||
// parent process.
|
||||
nsRefPtr<nsPrintingProxy> proxy = nsPrintingProxy::GetInstance();
|
||||
return proxy->SavePrintSettings(aPS, aUsePrinterNamePrefix, aFlags);
|
||||
}
|
||||
|
||||
nsAutoString prtName;
|
||||
|
||||
// Do not use printer name in Linux because GTK backend does not support
|
||||
|
|
Загрузка…
Ссылка в новой задаче