This commit is contained in:
danm%netscape.com 1999-04-06 00:09:54 +00:00
Родитель fc3d4434ae
Коммит 3cdd0fd07a
3 изменённых файлов: 15 добавлений и 0 удалений

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

@ -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 {