зеркало из https://github.com/mozilla/pjs.git
adding CloseWindow
This commit is contained in:
Родитель
fc3d4434ae
Коммит
3cdd0fd07a
|
@ -7,4 +7,5 @@ interface ToolkitCore : BaseAppCore
|
|||
void ShowDialog(in wstring url, in Window parent);
|
||||
void ShowWindow(in wstring url, in Window parent);
|
||||
void ShowModalDialog(in wstring url, in Window parent);
|
||||
void CloseWindow(in Window window);
|
||||
};
|
||||
|
|
|
@ -40,6 +40,8 @@ public:
|
|||
NS_IMETHOD ShowWindow(const nsString& aUrl, nsIDOMWindow* aParent)=0;
|
||||
|
||||
NS_IMETHOD ShowModalDialog(const nsString& aUrl, nsIDOMWindow* aParent)=0;
|
||||
|
||||
NS_IMETHOD CloseWindow(nsIDOMWindow* aWindow)=0;
|
||||
};
|
||||
|
||||
|
||||
|
@ -47,6 +49,7 @@ public:
|
|||
NS_IMETHOD ShowDialog(const nsString& aUrl, nsIDOMWindow* aParent); \
|
||||
NS_IMETHOD ShowWindow(const nsString& aUrl, nsIDOMWindow* aParent); \
|
||||
NS_IMETHOD ShowModalDialog(const nsString& aUrl, nsIDOMWindow* aParent); \
|
||||
NS_IMETHOD CloseWindow(nsIDOMWindow* aWindow); \
|
||||
|
||||
|
||||
|
||||
|
@ -54,6 +57,7 @@ public:
|
|||
NS_IMETHOD ShowDialog(const nsString& aUrl, nsIDOMWindow* aParent) { return _to##ShowDialog(aUrl, aParent); } \
|
||||
NS_IMETHOD ShowWindow(const nsString& aUrl, nsIDOMWindow* aParent) { return _to##ShowWindow(aUrl, aParent); } \
|
||||
NS_IMETHOD ShowModalDialog(const nsString& aUrl, nsIDOMWindow* aParent) { return _to##ShowModalDialog(aUrl, aParent); } \
|
||||
NS_IMETHOD CloseWindow(nsIDOMWindow* aWindow) { return _to##CloseWindow(aWindow); } \
|
||||
|
||||
|
||||
extern "C" NS_DOM nsresult NS_InitToolkitCoreClass(nsIScriptContext *aContext, void **aPrototype);
|
||||
|
|
|
@ -230,6 +230,16 @@ nsToolkitCore::ShowModalDialog(const nsString& aUrl, nsIDOMWindow* aParent) {
|
|||
return rv;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsToolkitCore::CloseWindow(nsIDOMWindow* aWindow) {
|
||||
|
||||
nsCOMPtr<nsIWebShellWindow> window = DOMWindowToWebShellWindow(aWindow);
|
||||
if (window)
|
||||
window->Close();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
// horribly complicated routine to simply convert from one to the other
|
||||
nsCOMPtr<nsIWebShellWindow>
|
||||
nsToolkitCore::DOMWindowToWebShellWindow(nsIDOMWindow *DOMWindow) const {
|
||||
|
|
Загрузка…
Ссылка в новой задаче