Bug 351492 Make Camino implement

@mozilla.org/passwordmanager/authpromptfactory;1 so that its password manager
works again
r=hwaara sr=mento
This commit is contained in:
cbiesinger%web.de 2006-09-18 22:00:43 +00:00
Родитель 9f4e6ce901
Коммит 7c9d26b7f1
3 изменённых файлов: 23 добавлений и 3 удалений

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

@ -190,6 +190,12 @@ static const nsModuleComponentInfo gAppComponents[] = {
"@mozilla.org/embedcomp/prompt-service;1",
CocoaPromptServiceConstructor
},
{
"Auth prompt factory",
NS_PROMPTSERVICE_CID,
"@mozilla.org/passwordmanager/authpromptfactory;1",
CocoaPromptServiceConstructor
},
{
"Nonblocking Alert Service",
NS_NONBLOCKINGALERTSERVICE_CID,

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

@ -41,12 +41,13 @@
#include "nsIStringBundle.h"
#include "nsIPromptService.h"
#include "nsIPromptFactory.h"
#include "nsINonBlockingAlertService.h"
#include "nsICookiePromptService.h"
#include "nsCOMPtr.h"
#import <Cocoa/Cocoa.h>
class CocoaPromptService : public nsIPromptService, public nsICookiePromptService, public nsINonBlockingAlertService
class CocoaPromptService : public nsIPromptService, public nsICookiePromptService, public nsINonBlockingAlertService, public nsIPromptFactory
{
public:
CocoaPromptService();
@ -56,6 +57,7 @@ public:
NS_DECL_NSIPROMPTSERVICE;
NS_DECL_NSICOOKIEPROMPTSERVICE;
NS_DECL_NSINONBLOCKINGALERTSERVICE;
NS_DECL_NSIPROMPTFACTORY;
private:
NSString *GetCommonDialogLocaleString(const char *s);

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

@ -54,7 +54,7 @@ CocoaPromptService::~CocoaPromptService()
{
}
NS_IMPL_ISUPPORTS3(CocoaPromptService, nsIPromptService, nsINonBlockingAlertService, nsICookiePromptService)
NS_IMPL_ISUPPORTS4(CocoaPromptService, nsIPromptService, nsINonBlockingAlertService, nsICookiePromptService, nsIPromptFactory)
/* void alert (in nsIDOMWindow parent, in wstring dialogTitle, in wstring text); */
NS_IMETHODIMP
@ -633,4 +633,16 @@ CocoaPromptService::CookieDialog(nsIDOMWindow *parent, nsICookie *cookie, const
return NS_OK;
}
// nsIPromptFactory implementation
/* void getPrompt(in nsIDOMWindow aParent, in nsIIDRef iid, [iid_is(iid),retval] out nsQIResult result); */
NS_IMETHODIMP
CocoaPromptService::GetPrompt(nsIDOMWindow* aParent, const nsIID& iid, void** result)
{
// NOTE: We must implement this interface and have a stub for this method as
// a signal that we have a password manager implementation.
// However, we don't necessarily need to return anything here - if we don't,
// the older nsIAuthPrompt/nsIAuthPromptWrapper interfaces will be used.
// Implementing this correctly does not provide much advantage at the
// moment.
return NS_NOINTERFACE;
}