replace the hardcode of "@mozilla.org/embedcomp/dialogparam;1" with NS_DIALOGPARAMBLOCK_CONTRACTID
Bug 158608 r=Henry sr=alecf
This commit is contained in:
Родитель
45592f7692
Коммит
e5c68f5f9b
|
@ -62,9 +62,6 @@ static const char *kPrintProgressDialogURL = "chrome://global/content/printProgr
|
|||
static const char *kPrtPrvProgressDialogURL = "chrome://global/content/printPreviewProgress.xul";
|
||||
static const char *kPageSetupDialogURL = "chrome://communicator/content/printPageSetup.xul";
|
||||
|
||||
#define NS_DIALOGPARAMBLOCK_CONTRACTID \
|
||||
"@mozilla.org/embedcomp/dialogparam;1"
|
||||
|
||||
/****************************************************************
|
||||
************************* ParamBlock ***************************
|
||||
****************************************************************/
|
||||
|
|
|
@ -57,9 +57,6 @@ static const char *kPrtPrvProgressDialogURL = "chrome://global/content/printPrev
|
|||
static const char *kPageSetupDialogURL = "chrome://communicator/content/printPageSetup.xul";
|
||||
static const char *kPrinterPropertiesURL = "chrome://global/content/printjoboptions.xul";
|
||||
|
||||
#define NS_DIALOGPARAMBLOCK_CONTRACTID \
|
||||
"@mozilla.org/embedcomp/dialogparam;1"
|
||||
|
||||
/****************************************************************
|
||||
************************* ParamBlock ***************************
|
||||
****************************************************************/
|
||||
|
|
|
@ -54,8 +54,6 @@
|
|||
#include "nsIInterfaceRequestorUtils.h"
|
||||
|
||||
|
||||
#define NS_DIALOGPARAMBLOCK_CONTRACTID "@mozilla.org/embedcomp/dialogparam;1"
|
||||
|
||||
static const char *kPrintProgressDialogURL = "chrome://global/content/printProgress.xul";
|
||||
static const char *kPrtPrvProgressDialogURL = "chrome://global/content/printPreviewProgress.xul";
|
||||
static const char *kPageSetupDialogURL = "chrome://communicator/content/printPageSetup.xul";
|
||||
|
|
|
@ -50,8 +50,6 @@ interface nsIDialogParamBlock: nsISupports {
|
|||
};
|
||||
|
||||
%{C++
|
||||
// {f76c0901-437a-11d3-b7a0-e35db351b4bc}
|
||||
#define NS_DIALOGPARAMBLOCK_IID \
|
||||
{0xf76c0901, 0x437a, 0x11d3, {0xb7, 0xa0, 0xe3, 0x5d, 0xb3, 0x51, 0xb4, 0xbc}}
|
||||
#define NS_DIALOGPARAMBLOCK_CONTRACTID "@mozilla.org/embedcomp/dialogparam;1"
|
||||
%}
|
||||
|
||||
|
|
|
@ -44,8 +44,6 @@
|
|||
// {4E4AAE11-8901-46cc-8217-DAD7C5415873}
|
||||
#define NS_DIALOGPARAMBLOCK_CID \
|
||||
{0x4e4aae11, 0x8901, 0x46cc, {0x82, 0x17, 0xda, 0xd7, 0xc5, 0x41, 0x58, 0x73}}
|
||||
#define NS_DIALOGPARAMBLOCK_CONTRACTID \
|
||||
"@mozilla.org/embedcomp/dialogparam;1"
|
||||
|
||||
class nsString;
|
||||
|
||||
|
|
|
@ -280,7 +280,7 @@ nsPrintOptions::ShowPrintSetupDialog(nsIPrintSettings *aPS)
|
|||
NS_ASSERTION(psSupports, "PrintSettings must be a supports");
|
||||
array->AppendElement(psSupports);
|
||||
|
||||
nsCOMPtr<nsIDialogParamBlock> ioParamBlock(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
|
||||
nsCOMPtr<nsIDialogParamBlock> ioParamBlock(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
|
||||
if (ioParamBlock) {
|
||||
ioParamBlock->SetInt(0, 0);
|
||||
nsCOMPtr<nsISupports> blkSupps(do_QueryInterface(ioParamBlock));
|
||||
|
|
|
@ -158,7 +158,7 @@ AlertMissingFonts(nsString& aMissingFonts)
|
|||
if (!wwatch)
|
||||
return;
|
||||
|
||||
nsCOMPtr<nsIDialogParamBlock> paramBlock(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
|
||||
nsCOMPtr<nsIDialogParamBlock> paramBlock(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
|
||||
if (!paramBlock)
|
||||
return;
|
||||
|
||||
|
|
|
@ -476,7 +476,7 @@ nsPrefMigration::ShowSpaceDialog(PRInt32 *choice)
|
|||
nsCOMPtr<nsIWindowWatcher> windowWatcher(do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIDialogParamBlock> ioParamBlock(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1", &rv));
|
||||
nsCOMPtr<nsIDialogParamBlock> ioParamBlock(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID, &rv));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
ioParamBlock->SetInt(0,3); //set the Retry, CreateNew and Cancel buttons
|
||||
|
|
|
@ -129,8 +129,6 @@
|
|||
#define CHROME_STYLE nsIWebBrowserChrome::CHROME_ALL | nsIWebBrowserChrome::CHROME_CENTER_SCREEN
|
||||
#endif
|
||||
|
||||
const char* kDialogParamBlockContractID = "@mozilla.org/embedcomp/dialogparam;1";
|
||||
|
||||
const char* kDefaultOpenWindowParams = "centerscreen,chrome,modal,titlebar";
|
||||
|
||||
const char* kBrandBundleURL = "chrome://global/locale/brand.properties";
|
||||
|
@ -574,7 +572,7 @@ nsProfile::LoadDefaultProfileDir(nsCString & profileURLStr, PRBool canInteract)
|
|||
// We need to send a param to OpenWindow if the window is to be considered
|
||||
// a dialog. It needs to be for script security reasons. This param block
|
||||
// will be made use of soon. See bug 66833.
|
||||
nsCOMPtr<nsIDialogParamBlock> ioParamBlock(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1", &rv));
|
||||
nsCOMPtr<nsIDialogParamBlock> ioParamBlock(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID, &rv));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIDOMWindow> newWindow;
|
||||
|
@ -2360,7 +2358,7 @@ nsProfile::ShowProfileWizard(void)
|
|||
nsCOMPtr<nsIWindowWatcher> windowWatcher(do_GetService(NS_WINDOWWATCHER_CONTRACTID, &rv));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
|
||||
nsCOMPtr<nsIDialogParamBlock> ioParamBlock(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1", &rv));
|
||||
nsCOMPtr<nsIDialogParamBlock> ioParamBlock(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID, &rv));
|
||||
if (NS_FAILED(rv)) return rv;
|
||||
ioParamBlock->SetInt(0,4); // standard wizard buttons
|
||||
|
||||
|
|
|
@ -169,7 +169,7 @@ nsNSSDialogs::SetPassword(nsIInterfaceRequestor *ctx,
|
|||
// Get the parent window for the dialog
|
||||
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
|
||||
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
|
||||
if (!block) return NS_ERROR_FAILURE;
|
||||
|
||||
// void ChangePassword(in wstring tokenName, out int status);
|
||||
|
@ -202,7 +202,7 @@ nsNSSDialogs::GetPassword(nsIInterfaceRequestor *ctx,
|
|||
*_canceled = PR_FALSE;
|
||||
// Get the parent window for the dialog
|
||||
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
|
||||
if (!block) return NS_ERROR_FAILURE;
|
||||
// Set the token name in the window
|
||||
rv = block->SetString(1, tokenName);
|
||||
|
@ -726,7 +726,7 @@ nsNSSDialogs::CACertExists(nsIInterfaceRequestor *ctx,PRBool *_canceled)
|
|||
// Get the parent window for the dialog
|
||||
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
|
||||
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
|
||||
if (!block) return NS_ERROR_FAILURE;
|
||||
|
||||
|
||||
|
@ -749,7 +749,7 @@ nsNSSDialogs::ChooseCertificate(nsIInterfaceRequestor *ctx, const PRUnichar *cn,
|
|||
// Get the parent window for the dialog
|
||||
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
|
||||
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
|
||||
if (!block) return NS_ERROR_FAILURE;
|
||||
|
||||
block->SetNumberStrings(4+count*2);
|
||||
|
@ -811,7 +811,7 @@ nsNSSDialogs::PickCertificate(nsIInterfaceRequestor *ctx,
|
|||
// Get the parent window for the dialog
|
||||
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
|
||||
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
|
||||
if (!block) return NS_ERROR_FAILURE;
|
||||
|
||||
block->SetNumberStrings(1+count*2);
|
||||
|
@ -864,7 +864,7 @@ nsNSSDialogs::SetPKCS12FilePassword(nsIInterfaceRequestor *ctx,
|
|||
*_canceled = PR_FALSE;
|
||||
// Get the parent window for the dialog
|
||||
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
|
||||
if (!block) return NS_ERROR_FAILURE;
|
||||
// open up the window
|
||||
rv = nsNSSDialogHelper::openDialog(parent,
|
||||
|
@ -897,7 +897,7 @@ nsNSSDialogs::GetPKCS12FilePassword(nsIInterfaceRequestor *ctx,
|
|||
*_canceled = PR_FALSE;
|
||||
// Get the parent window for the dialog
|
||||
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(ctx);
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
|
||||
if (!block) return NS_ERROR_FAILURE;
|
||||
// open up the window
|
||||
rv = nsNSSDialogHelper::openDialog(parent,
|
||||
|
@ -960,7 +960,7 @@ nsNSSDialogs::ChooseToken(nsIInterfaceRequestor *aCtx, const PRUnichar **aTokenL
|
|||
// Get the parent window for the dialog
|
||||
nsCOMPtr<nsIDOMWindowInternal> parent = do_GetInterface(aCtx);
|
||||
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1"));
|
||||
nsCOMPtr<nsIDialogParamBlock> block(do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID));
|
||||
if (!block) return NS_ERROR_FAILURE;
|
||||
|
||||
block->SetNumberStrings(aCount);
|
||||
|
|
|
@ -48,7 +48,7 @@ nsPKIParamBlock::nsPKIParamBlock()
|
|||
nsresult
|
||||
nsPKIParamBlock::Init()
|
||||
{
|
||||
mDialogParamBlock = do_CreateInstance("@mozilla.org/embedcomp/dialogparam;1");
|
||||
mDialogParamBlock = do_CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID);
|
||||
return (mDialogParamBlock == nsnull) ? NS_ERROR_OUT_OF_MEMORY : NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -666,7 +666,7 @@ NS_IMETHODIMP
|
|||
nsXPInstallManager::LoadParams(PRUint32 aCount, const PRUnichar** aPackageList, nsIDialogParamBlock** aParams)
|
||||
{
|
||||
nsIDialogParamBlock* paramBlock = 0;
|
||||
nsresult rv = nsComponentManager::CreateInstance("@mozilla.org/embedcomp/dialogparam;1",
|
||||
nsresult rv = nsComponentManager::CreateInstance(NS_DIALOGPARAMBLOCK_CONTRACTID,
|
||||
nsnull,
|
||||
NS_GET_IID(nsIDialogParamBlock),
|
||||
(void**)¶mBlock);
|
||||
|
|
Загрузка…
Ссылка в новой задаче