diff --git a/build/mac/NGLayoutBuildList.pm b/build/mac/NGLayoutBuildList.pm index 06fc0fa9255..98b3e96c092 100644 --- a/build/mac/NGLayoutBuildList.pm +++ b/build/mac/NGLayoutBuildList.pm @@ -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"); diff --git a/xpfe/AppCores/idl/BrowserAppCore.idl b/xpfe/AppCores/idl/BrowserAppCore.idl index 2f859cf040e..d0d0b5b60cc 100644 --- a/xpfe/AppCores/idl/BrowserAppCore.idl +++ b/xpfe/AppCores/idl/BrowserAppCore.idl @@ -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(); diff --git a/xpfe/AppCores/public/nsIDOMBrowserAppCore.h b/xpfe/AppCores/public/nsIDOMBrowserAppCore.h index acf7288e6a1..4c4577900f8 100644 --- a/xpfe/AppCores/public/nsIDOMBrowserAppCore.h +++ b/xpfe/AppCores/public/nsIDOMBrowserAppCore.h @@ -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(); } \ diff --git a/xpfe/AppCores/src/nsBrowserAppCore.cpp b/xpfe/AppCores/src/nsBrowserAppCore.cpp index d9c9f43f0b0..52f8c5b5ccf 100644 --- a/xpfe/AppCores/src/nsBrowserAppCore.cpp +++ b/xpfe/AppCores/src/nsBrowserAppCore.cpp @@ -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; } diff --git a/xpfe/AppCores/src/nsBrowserAppCore.h b/xpfe/AppCores/src/nsBrowserAppCore.h index 7f3fd379030..6cc1e62fe6e 100644 --- a/xpfe/AppCores/src/nsBrowserAppCore.h +++ b/xpfe/AppCores/src/nsBrowserAppCore.h @@ -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(); diff --git a/xpfe/AppCores/src/nsJSBrowserAppCore.cpp b/xpfe/AppCores/src/nsJSBrowserAppCore.cpp index 6ae03c3e6bc..f5211080d82 100644 --- a/xpfe/AppCores/src/nsJSBrowserAppCore.cpp +++ b/xpfe/AppCores/src/nsJSBrowserAppCore.cpp @@ -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}, diff --git a/xpfe/browser/src/navigator.xul b/xpfe/browser/src/navigator.xul index ccfa56de24f..15dd740def8 100644 --- a/xpfe/browser/src/navigator.xul +++ b/xpfe/browser/src/navigator.xul @@ -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 @@ + @@ -1068,7 +1079,7 @@ - +