add ability to change wallet password

This commit is contained in:
morse%netscape.com 1999-05-04 18:07:32 +00:00
Родитель c3c317e4d6
Коммит c032276041
7 изменённых файлов: 75 добавлений и 4 удалений

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

@ -669,6 +669,7 @@ sub MakeResourceAliases()
#//
MakeAlias(":mozilla:layout:html:document:src:ua.css", "$resource_dir");
MakeAlias(":mozilla:webshell:tests:viewer:resources:viewer.properties", "$resource_dir");
MakeAlias(":mozilla:extensions:wallet:src:wallet.properties", "$resource_dir");
my($html_dir) = "$resource_dir" . "html:";
MakeAlias(":mozilla:layout:html:base:src:broken-image.gif", "$html_dir");

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

@ -12,6 +12,7 @@ interface BrowserAppCore : BaseAppCore
void loadInitialPage();
void walletEditor();
void walletChangePassword();
void walletSafeFillin(in Window win);
void walletQuickFillin(in Window win);
void walletSamples();

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

@ -47,6 +47,8 @@ public:
NS_IMETHOD WalletEditor()=0;
NS_IMETHOD WalletChangePassword()=0;
NS_IMETHOD WalletSafeFillin(nsIDOMWindow* aWin)=0;
NS_IMETHOD WalletQuickFillin(nsIDOMWindow* aWin)=0;
@ -90,6 +92,7 @@ public:
NS_IMETHOD LoadUrl(const nsString& aUrl); \
NS_IMETHOD LoadInitialPage(); \
NS_IMETHOD WalletEditor(); \
NS_IMETHOD WalletChangePassword(); \
NS_IMETHOD WalletSafeFillin(nsIDOMWindow* aWin); \
NS_IMETHOD WalletQuickFillin(nsIDOMWindow* aWin); \
NS_IMETHOD WalletSamples(); \
@ -117,6 +120,7 @@ public:
NS_IMETHOD LoadUrl(const nsString& aUrl) { return _to LoadUrl(aUrl); } \
NS_IMETHOD LoadInitialPage() { return _to LoadInitialPage(); } \
NS_IMETHOD WalletEditor() { return _to WalletEditor(); } \
NS_IMETHOD WalletChangePassword() { return _to WalletChangePassword(); } \
NS_IMETHOD WalletSafeFillin(nsIDOMWindow* aWin) { return _to WalletSafeFillin(aWin); } \
NS_IMETHOD WalletQuickFillin(nsIDOMWindow* aWin) { return _to WalletQuickFillin(aWin); } \
NS_IMETHOD WalletSamples() { return _to WalletSamples(); } \

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

@ -406,6 +406,21 @@ nsBrowserAppCore::WalletEditor()
return newWind(WALLET_EDITOR_URL);
}
NS_IMETHODIMP
nsBrowserAppCore::WalletChangePassword()
{
nsIWalletService *walletservice;
nsresult res;
res = nsServiceManager::GetService(kWalletServiceCID,
kIWalletServiceIID,
(nsISupports **)&walletservice);
if ((NS_OK == res) && (nsnull != walletservice)) {
res = walletservice->WALLET_ChangePassword();
nsServiceManager::ReleaseService(kWalletServiceCID, walletservice);
}
return NS_OK;
}
NS_IMETHODIMP
nsBrowserAppCore::WalletSafeFillin(nsIDOMWindow* aWin)
{
@ -433,7 +448,7 @@ nsBrowserAppCore::WalletSafeFillin(nsIDOMWindow* aWin)
}
#ifndef HTMLDialogs
return newWind("file:///y|/htmldlgs.htm");
return newWind("file:///htmldlgs.htm");
#endif
return NS_OK;
@ -488,6 +503,10 @@ nsBrowserAppCore::WalletSamples() {
return NS_OK;
}
NS_IMETHODIMP
nsBrowserAppCore::WalletChangePassword() {
return NS_OK;
}
NS_IMETHODIMP
nsBrowserAppCore::WalletQuickFillin(nsIDOMWindow*) {
return NS_OK;
}
@ -511,7 +530,7 @@ nsBrowserAppCore::SignonViewer()
nsServiceManager::ReleaseService(kWalletServiceCID, walletservice);
}
#ifndef HTMLDialogs
return newWind("file:///y|/htmldlgs.htm");
return newWind("file:///htmldlgs.htm");
#endif
return NS_OK;
}
@ -537,7 +556,7 @@ nsBrowserAppCore::CookieViewer()
nsServiceManager::ReleaseService(kNetServiceCID, netservice);
}
#ifndef HTMLDialogs
return newWind("file:///y|/htmldlgs.htm");
return newWind("file:///htmldlgs.htm");
#endif
return NS_OK;
}

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

@ -66,6 +66,7 @@ class nsBrowserAppCore : public nsBaseAppCore,
NS_IMETHOD Stop();
NS_IMETHOD WalletEditor();
NS_IMETHOD WalletChangePassword();
NS_IMETHOD WalletSafeFillin(nsIDOMWindow* aWin);
NS_IMETHOD WalletQuickFillin(nsIDOMWindow* aWin);
NS_IMETHOD WalletSamples();

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

@ -297,6 +297,39 @@ BrowserAppCoreWalletEditor(JSContext *cx, JSObject *obj, uintN argc, jsval *argv
}
//
// Native method WalletChangePassword
//
PR_STATIC_CALLBACK(JSBool)
BrowserAppCoreWalletChangePassword(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->WalletChangePassword()) {
return JS_FALSE;
}
*rval = JSVAL_VOID;
}
else {
JS_ReportError(cx, "Function walletChangePassword requires 0 parameters");
return JS_FALSE;
}
return JS_TRUE;
}
//
// Native method WalletSafeFillin
//
@ -940,6 +973,7 @@ static JSFunctionSpec BrowserAppCoreMethods[] =
{"loadUrl", BrowserAppCoreLoadUrl, 1},
{"loadInitialPage", BrowserAppCoreLoadInitialPage, 0},
{"walletEditor", BrowserAppCoreWalletEditor, 0},
{"walletChangePassword", BrowserAppCoreWalletChangePassword, 0},
{"walletSafeFillin", BrowserAppCoreWalletSafeFillin, 0},
{"walletQuickFillin", BrowserAppCoreWalletQuickFillin, 0},
{"walletSamples", BrowserAppCoreWalletSamples, 0},

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

@ -486,6 +486,16 @@
}
}
function WalletChangePassword()
{
if (appCore != null) {
dump("Wallet Change Password\n");
appCore.walletChangePassword();
} else {
dump("BrowserAppCore has not been created!\n");
}
}
function WalletQuickFillin()
{
if (appCore != null) {
@ -649,6 +659,7 @@
<menuitem name="Display Cookies" onclick="CookieViewer();"/>
<separator />
<menuitem name="Samples" onclick="WalletSamples();"/>
<menuitem name="Change Password" onclick="WalletChangePassword();"/>
</menu>
<separator />
<menuitem name="Select All" onclick="BrowserReload();"/>
@ -1068,7 +1079,7 @@
<spring flex="100%"/>
<titledbutton align="right" value="Build ID: 1999042310" style="font-family:sans-serif;font-size:2.5mm;"/>
<titledbutton align="right" value="Build ID: 1999043018" style="font-family:sans-serif;font-size:2.5mm;"/>
<titledbutton id="security-button" class="insecure" value="Secure Conn" align="right" onclick="securityOff();"/>
</box>