From 23b28379e533f0c7e03ca15f01055bae14a03b56 Mon Sep 17 00:00:00 2001 From: "morse%netscape.com" Date: Wed, 21 Apr 1999 03:43:49 +0000 Subject: [PATCH] add cookie viewer and singon viewer --- xpfe/AppCores/src/nsJSBrowserAppCore.cpp | 67 ++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/xpfe/AppCores/src/nsJSBrowserAppCore.cpp b/xpfe/AppCores/src/nsJSBrowserAppCore.cpp index 56af3442e41f..061b80fc35be 100644 --- a/xpfe/AppCores/src/nsJSBrowserAppCore.cpp +++ b/xpfe/AppCores/src/nsJSBrowserAppCore.cpp @@ -396,6 +396,71 @@ BrowserAppCoreWalletSamples(JSContext *cx, JSObject *obj, uintN argc, jsval *arg } +// +// Native method SignonViewer +// +PR_STATIC_CALLBACK(JSBool) +BrowserAppCoreSignonViewer(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMBrowserAppCore *nativeThis = (nsIDOMBrowserAppCore*)JS_GetPrivate(cx, obj); + JSBool rBool = JS_FALSE; + + *rval = JSVAL_NULL; + + // If there's no private data, this must be the prototype, so ignore + if (nsnull == nativeThis) { + return JS_TRUE; + } + + if (argc >= 0) { + + if (NS_OK != nativeThis->SignonViewer()) { + return JS_FALSE; + } + + *rval = JSVAL_VOID; + } + else { + JS_ReportError(cx, "Function signonViewer requires 0 parameters"); + return JS_FALSE; + } + + return JS_TRUE; +} + + +// +// Native method CookieViewer +// +PR_STATIC_CALLBACK(JSBool) +BrowserAppCoreCookieViewer(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *rval) +{ + nsIDOMBrowserAppCore *nativeThis = (nsIDOMBrowserAppCore*)JS_GetPrivate(cx, obj); + JSBool rBool = JS_FALSE; + + *rval = JSVAL_NULL; + + // If there's no private data, this must be the prototype, so ignore + if (nsnull == nativeThis) { + return JS_TRUE; + } + + if (argc >= 0) { + + if (NS_OK != nativeThis->CookieViewer()) { + return JS_FALSE; + } + + *rval = JSVAL_VOID; + } + else { + JS_ReportError(cx, "Function cookieViewer requires 0 parameters"); + return JS_FALSE; + } + + return JS_TRUE; +} + // // Native method SetToolbarWindow // @@ -793,6 +858,8 @@ static JSFunctionSpec BrowserAppCoreMethods[] = {"walletSafeFillin", BrowserAppCoreWalletSafeFillin, 0}, {"walletQuickFillin", BrowserAppCoreWalletQuickFillin, 0}, {"walletSamples", BrowserAppCoreWalletSamples, 0}, + {"signonViewer", BrowserAppCoreSignonViewer, 0}, + {"cookieViewer", BrowserAppCoreCookieViewer, 0}, {"setToolbarWindow", BrowserAppCoreSetToolbarWindow, 1}, {"setContentWindow", BrowserAppCoreSetContentWindow, 1}, {"setWebShellWindow", BrowserAppCoreSetWebShellWindow, 1},