зеркало из https://github.com/mozilla/gecko-dev.git
add wallet samples
This commit is contained in:
Родитель
50e0a0cb52
Коммит
9d6bc5a897
|
@ -12,6 +12,7 @@ interface BrowserAppCore : BaseAppCore
|
||||||
void walletEditor();
|
void walletEditor();
|
||||||
void walletSafeFillin();
|
void walletSafeFillin();
|
||||||
void walletQuickFillin();
|
void walletQuickFillin();
|
||||||
|
void walletSamples();
|
||||||
|
|
||||||
void setToolbarWindow(in Window win);
|
void setToolbarWindow(in Window win);
|
||||||
void setContentWindow(in Window win);
|
void setContentWindow(in Window win);
|
||||||
|
|
|
@ -43,6 +43,7 @@ public:
|
||||||
NS_IMETHOD WalletEditor()=0;
|
NS_IMETHOD WalletEditor()=0;
|
||||||
NS_IMETHOD WalletSafeFillin()=0;
|
NS_IMETHOD WalletSafeFillin()=0;
|
||||||
NS_IMETHOD WalletQuickFillin()=0;
|
NS_IMETHOD WalletQuickFillin()=0;
|
||||||
|
NS_IMETHOD WalletSamples()=0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NS_IMETHOD LoadUrl(const nsString& aUrl)=0;
|
NS_IMETHOD LoadUrl(const nsString& aUrl)=0;
|
||||||
|
|
|
@ -224,6 +224,9 @@ nsBrowserAppCore::Forward()
|
||||||
//#define WALLET_EDITOR_URL "http://peoplestage/morse/wallet/walleted.html"
|
//#define WALLET_EDITOR_URL "http://peoplestage/morse/wallet/walleted.html"
|
||||||
#define WALLET_EDITOR_URL "http://people.netscape.com/morse/wallet/walleted.html"
|
#define WALLET_EDITOR_URL "http://people.netscape.com/morse/wallet/walleted.html"
|
||||||
|
|
||||||
|
#define WALLET_SAMPLES_URL "http://people.netscape.com/morse/wallet/samples"
|
||||||
|
//#define WALLET_SAMPLES_URL "http://peoplestage/morse/wallet/samples"
|
||||||
|
|
||||||
PRInt32
|
PRInt32
|
||||||
newWindow(char* urlName) {
|
newWindow(char* urlName) {
|
||||||
nsresult rv;
|
nsresult rv;
|
||||||
|
@ -271,6 +274,7 @@ newWindow(char* urlName) {
|
||||||
controllerCID = "43147b80-8a39-11d2-9938-0080c7cb1081";
|
controllerCID = "43147b80-8a39-11d2-9938-0080c7cb1081";
|
||||||
appShell->CreateTopLevelWindow(nsnull, url, controllerCID, newWindow,
|
appShell->CreateTopLevelWindow(nsnull, url, controllerCID, newWindow,
|
||||||
nsnull, nsnull, 615, 650);
|
nsnull, nsnull, 615, 650);
|
||||||
|
|
||||||
NS_RELEASE(url);
|
NS_RELEASE(url);
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
@ -379,6 +383,15 @@ nsBrowserAppCore::WalletQuickFillin()
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NS_IMETHODIMP
|
||||||
|
nsBrowserAppCore::WalletSamples()
|
||||||
|
{
|
||||||
|
/* bring up the samples in a new window */
|
||||||
|
mContentAreaWebShell->LoadURL(nsString(WALLET_SAMPLES_URL), nsnull, nsnull);
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
|
|
|
@ -66,6 +66,7 @@ class nsBrowserAppCore : public nsBaseAppCore,
|
||||||
NS_IMETHOD WalletEditor();
|
NS_IMETHOD WalletEditor();
|
||||||
NS_IMETHOD WalletSafeFillin();
|
NS_IMETHOD WalletSafeFillin();
|
||||||
NS_IMETHOD WalletQuickFillin();
|
NS_IMETHOD WalletQuickFillin();
|
||||||
|
NS_IMETHOD WalletSamples();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
NS_IMETHOD LoadUrl(const nsString& aUrl);
|
NS_IMETHOD LoadUrl(const nsString& aUrl);
|
||||||
|
|
|
@ -294,6 +294,39 @@ BrowserAppCoreWalletQuickFillin(JSContext *cx, JSObject *obj, uintN argc, jsval
|
||||||
|
|
||||||
return JS_TRUE;
|
return JS_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
//
|
||||||
|
// Native method WalletSamples
|
||||||
|
//
|
||||||
|
PR_STATIC_CALLBACK(JSBool)
|
||||||
|
BrowserAppCoreWalletSamples(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->WalletSamples()) {
|
||||||
|
return JS_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
*rval = JSVAL_VOID;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
JS_ReportError(cx, "Function walletSamples requires 0 parameters");
|
||||||
|
return JS_FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
return JS_TRUE;
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
@ -701,6 +734,7 @@ static JSFunctionSpec BrowserAppCoreMethods[] =
|
||||||
{"walletEditor", BrowserAppCoreWalletEditor, 0},
|
{"walletEditor", BrowserAppCoreWalletEditor, 0},
|
||||||
{"walletSafeFillin", BrowserAppCoreWalletSafeFillin, 0},
|
{"walletSafeFillin", BrowserAppCoreWalletSafeFillin, 0},
|
||||||
{"walletQuickFillin", BrowserAppCoreWalletQuickFillin, 0},
|
{"walletQuickFillin", BrowserAppCoreWalletQuickFillin, 0},
|
||||||
|
{"walletSamples", BrowserAppCoreWalletSamples, 0},
|
||||||
#endif
|
#endif
|
||||||
{"loadUrl", BrowserAppCoreLoadUrl, 1},
|
{"loadUrl", BrowserAppCoreLoadUrl, 1},
|
||||||
{"setToolbarWindow", BrowserAppCoreSetToolbarWindow, 1},
|
{"setToolbarWindow", BrowserAppCoreSetToolbarWindow, 1},
|
||||||
|
|
|
@ -283,6 +283,17 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function WalletSamples()
|
||||||
|
{
|
||||||
|
appCore = XPAppCoresManager.Find("BrowserAppCore");
|
||||||
|
if (appCore != null) {
|
||||||
|
dump("Wallet Samples\n");
|
||||||
|
appCore.walletSamples();
|
||||||
|
} else {
|
||||||
|
dump("BrowserAppCore has not been created!\n");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</html:script>
|
</html:script>
|
||||||
|
|
||||||
|
@ -443,6 +454,8 @@
|
||||||
<menuitem name="Wallet contents" onclick="WalletEditor();"/>
|
<menuitem name="Wallet contents" onclick="WalletEditor();"/>
|
||||||
<menuitem name="Safe fillins" onclick="WalletSafeFillin();"/>
|
<menuitem name="Safe fillins" onclick="WalletSafeFillin();"/>
|
||||||
<menuitem name="Quick fillins" onclick="WalletQuickFillin();"/>
|
<menuitem name="Quick fillins" onclick="WalletQuickFillin();"/>
|
||||||
|
<separator />
|
||||||
|
<menuitem name="Samples" onclick="WalletSamples();"/>
|
||||||
</menu>
|
</menu>
|
||||||
<menu name="Help">
|
<menu name="Help">
|
||||||
<menuitem name="Help Contents" onclick="BrowserReload();"/>
|
<menuitem name="Help Contents" onclick="BrowserReload();"/>
|
||||||
|
|
Загрузка…
Ссылка в новой задаче