removing use of nsNetSupportDialog. bug 72112 continued. r=hyatt,morse,mstoltz,various

This commit is contained in:
danm%netscape.com 2001-04-08 01:32:13 +00:00
Родитель 51e440b924
Коммит 9551de3157
11 изменённых файлов: 41 добавлений и 31 удалений

Просмотреть файл

@ -46,7 +46,6 @@
#include <nsIURI.h>
#include <nsIScriptGlobalObject.h>
#include <nsIScriptGlobalObjectOwner.h>
#include <nsINetSupportDialogService.h>
#include <nsIPrompt.h>
#include <nsICommonDialogs.h>

Просмотреть файл

@ -31,7 +31,6 @@
#include <nsIScriptGlobalObject.h>
#include <nsIScriptGlobalObjectOwner.h>
#include <nsLayoutCID.h>
#include <nsINetSupportDialogService.h>
#include <nsICommonDialogs.h>
// ****************************************************************************

Просмотреть файл

@ -32,7 +32,7 @@ MODULE = psmglue
IS_COMPONENT = 1
LIBRARY_NAME = psmglue
REQUIRES = xpcom string security necko uriloader intl dom js locale profile caps pref jar libreg widget layout appshell docshell oji
REQUIRES = xpcom string security necko uriloader intl dom js locale profile caps pref jar libreg widget layout appshell docshell oji windowwatcher
EXPORTS = \
nsPSMShimLayer.h \

Просмотреть файл

@ -25,6 +25,8 @@
#include "plstr.h"
#include "nsMemory.h"
#include "nsIServiceManager.h"
#include "nsIPrompt.h"
#include "nsIWindowWatcher.h"
#include "nsISecretDecoderRing.h"
@ -39,9 +41,9 @@
#include "nsNetUtil.h"
#include "nsFileStream.h"
#include "nsINetSupportDialogService.h"
#include "nsIStringBundle.h"
#include "nsIFileSpec.h"
#include "nsIWindowWatcher.h"
#include "nsFileLocations.h"
#include "prmem.h"
#include "prprf.h"
@ -54,7 +56,6 @@ static NS_DEFINE_IID(kIStringBundleServiceIID, NS_ISTRINGBUNDLESERVICE_IID);
static NS_DEFINE_IID(kStringBundleServiceCID, NS_STRINGBUNDLESERVICE_CID);
static NS_DEFINE_IID(kIPrefServiceIID, NS_IPREF_IID);
static NS_DEFINE_IID(kPrefServiceCID, NS_PREF_CID);
static NS_DEFINE_CID(kNetSupportDialogCID, NS_NETSUPPORTDIALOG_CID);
#define HEADER_VERSION_1 "#2b"
@ -147,9 +148,12 @@ Wallet_Confirm(PRUnichar * szMessage)
PRBool retval = PR_TRUE; /* default value */
nsresult res;
NS_WITH_SERVICE(nsIPrompt, dialog, kNetSupportDialogCID, &res);
if (NS_FAILED(res)) {
return retval;
nsCOMPtr<nsIPrompt> dialog;
nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1"));
if (wwatch)
wwatch->GetNewPrompter(0, getter_AddRefs(dialog));
if (!dialog) {
return NS_ERROR_FAILURE;
}
const nsAutoString message(szMessage);
@ -172,9 +176,12 @@ wallet_GetString(nsAutoString& result, PRUnichar * szMessage, PRUnichar * szMess
nsAutoString password;
nsresult res;
NS_WITH_SERVICE(nsIPrompt, dialog, kNetSupportDialogCID, &res);
if (NS_FAILED(res)) {
return res;
nsCOMPtr<nsIPrompt> dialog;
nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1"));
if (wwatch)
wwatch->GetNewPrompter(0, getter_AddRefs(dialog));
if (!dialog) {
return NS_ERROR_FAILURE;
}
PRUnichar* pwd = NULL;
@ -231,9 +238,12 @@ wallet_GetDoubleString(nsAutoString& result, PRUnichar * szMessage, PRUnichar *
nsAutoString password, password2;
nsresult res;
NS_WITH_SERVICE(nsIPrompt, dialog, kNetSupportDialogCID, &res);
if (NS_FAILED(res)) {
return res;
nsCOMPtr<nsIPrompt> dialog;
nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1"));
if (wwatch)
wwatch->GetNewPrompter(0, getter_AddRefs(dialog));
if (!dialog) {
return NS_ERROR_FAILURE;
}
PRUnichar* pwd = NULL;

Просмотреть файл

@ -25,7 +25,6 @@
#include "nsProxiedService.h"
#include "nsIEventQueueService.h"
#include "nsPSMUICallbacks.h"
#include "nsINetSupportDialogService.h"
#include "nsIFilePicker.h"
#include "nsAppShellCIDs.h"
@ -43,12 +42,12 @@
#include "nsIInterfaceRequestor.h"
#include "nsIPrompt.h"
#include "nsIScriptGlobalObject.h"
#include "nsIWindowWatcher.h"
#include "nsIURL.h"
#include "nsIXULWindow.h"
#include "nsIPref.h"
static NS_DEFINE_IID(kAppShellServiceCID, NS_APPSHELL_SERVICE_CID);
static NS_DEFINE_CID(kNetSupportDialogCID, NS_NETSUPPORTDIALOG_CID);
// Happy callbacks
@ -374,14 +373,14 @@ char * PromptUserCallback(void *arg, char *prompt, void* clientContext, int isPa
csi->GetNotificationCallbacks(getter_AddRefs(callbacks));
}
nsCOMPtr<nsIProxyObjectManager> proxyman(do_GetService(NS_XPCOMPROXY_CONTRACTID));
if (!proxyman) return nsnull;
if (csi && callbacks) {
// The notification callbacks object may not be safe, so
// proxy the call to get the nsIPrompt.
nsCOMPtr<nsIProxyObjectManager> proxyman(do_GetService(NS_XPCOMPROXY_CONTRACTID));
if (!proxyman) return nsnull;
nsCOMPtr<nsIInterfaceRequestor> proxiedCallbacks;
proxyman->GetProxyForObject(NS_UI_THREAD_EVENTQ,
NS_GET_IID(nsIInterfaceRequestor),
@ -405,13 +404,23 @@ char * PromptUserCallback(void *arg, char *prompt, void* clientContext, int isPa
NS_ASSERTION(PR_FALSE, "callbacks does not implement nsIPrompt");
return nsnull;
}
} else {
NS_WITH_PROXIED_SERVICE(nsIPrompt, tmpPrompt, kNetSupportDialogCID,
NS_UI_THREAD_EVENTQ, &rv);
proxyPrompt = tmpPrompt;
nsCOMPtr<nsIPrompt> prompter;
nsCOMPtr<nsIWindowWatcher> wwatch(do_GetService("@mozilla.org/embedcomp/window-watcher;1"));
if (wwatch)
wwatch->GetNewPrompter(0, getter_AddRefs(prompter));
if (prompter)
proxyman->GetProxyForObject(NS_UI_THREAD_EVENTQ,
NS_GET_IID(nsIPrompt),
prompter,
PROXY_SYNC,
getter_AddRefs(proxyPrompt));
if (!proxyPrompt) {
NS_ASSERTION(PR_FALSE, "failed to get proxied generic prompter");
return nsnull;
}
}
if (proxyPrompt) {
rv = proxyPrompt->PromptPassword(nsnull, NS_ConvertASCIItoUCS2(prompt).GetUnicode(),
NS_LITERAL_STRING(" ").get(), // hostname

Просмотреть файл

@ -57,7 +57,6 @@
#include "nsISecurityEventSink.h"
#include "nsINetSupportDialogService.h"
#include "nsIPrompt.h"
#include "nsICommonDialogs.h"
#include "nsIPref.h"

Просмотреть файл

@ -32,7 +32,6 @@
#include "nsIDOMWindowInternal.h"
#include "nsIServiceManager.h"
#include "nsIDialogParamBlock.h"
#include "nsINetSupportDialogService.h"
static NS_DEFINE_IID( kAppShellServiceCID, NS_APPSHELL_SERVICE_CID );
static NS_DEFINE_CID(kDialogParamBlockCID, NS_DialogParamBlock_CID);

Просмотреть файл

@ -34,7 +34,6 @@
#include "nsIDOMWindowInternal.h"
#include "nsIServiceManager.h"
#include "nsIDialogParamBlock.h"
#include "nsINetSupportDialogService.h"
static NS_DEFINE_IID( kAppShellServiceCID, NS_APPSHELL_SERVICE_CID );
static NS_DEFINE_CID(kDialogParamBlockCID, NS_DialogParamBlock_CID);

Просмотреть файл

@ -36,7 +36,6 @@
#include "nsIAppShellComponentImpl.h"
#include "nsIDOMWindowInternal.h"
#include "nsIDialogParamBlock.h"
#include "nsINetSupportDialogService.h"
static NS_DEFINE_IID( kAppShellServiceCID, NS_APPSHELL_SERVICE_CID );
static NS_DEFINE_CID(kDialogParamBlockCID, NS_DialogParamBlock_CID);

Просмотреть файл

@ -32,7 +32,6 @@
#include "nsIDOMWindowInternal.h"
#include "nsIServiceManager.h"
#include "nsIDialogParamBlock.h"
#include "nsINetSupportDialogService.h"
static NS_DEFINE_IID(kAppShellServiceCID, NS_APPSHELL_SERVICE_CID);
static NS_DEFINE_CID(kDialogParamBlockCID, NS_DialogParamBlock_CID);

Просмотреть файл

@ -42,8 +42,6 @@
#include "nsIURL.h"
#include "nsIStringBundle.h"
#include "nsINetSupportDialogService.h"
#include "nsMessengerMigrator.h"
#include "nsMsgBaseCID.h"
#include "nsMsgCompCID.h"