mshtml: Use HTMLWindow::alert in nsPromptService::Alert.
This commit is contained in:
parent
62f1ef9d85
commit
13f7784634
@ -39,6 +39,8 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
|||||||
|
|
||||||
#define HTMLWINDOW2_THIS(iface) DEFINE_THIS(HTMLWindow, HTMLWindow2, iface)
|
#define HTMLWINDOW2_THIS(iface) DEFINE_THIS(HTMLWindow, HTMLWindow2, iface)
|
||||||
|
|
||||||
|
static struct list window_list = LIST_INIT(window_list);
|
||||||
|
|
||||||
static HRESULT WINAPI HTMLWindow2_QueryInterface(IHTMLWindow2 *iface, REFIID riid, void **ppv)
|
static HRESULT WINAPI HTMLWindow2_QueryInterface(IHTMLWindow2 *iface, REFIID riid, void **ppv)
|
||||||
{
|
{
|
||||||
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
|
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
|
||||||
@ -85,8 +87,10 @@ static ULONG WINAPI HTMLWindow2_Release(IHTMLWindow2 *iface)
|
|||||||
|
|
||||||
TRACE("(%p) ref=%d\n", This, ref);
|
TRACE("(%p) ref=%d\n", This, ref);
|
||||||
|
|
||||||
if(!ref)
|
if(!ref) {
|
||||||
|
list_remove(&This->entry);
|
||||||
mshtml_free(This);
|
mshtml_free(This);
|
||||||
|
}
|
||||||
|
|
||||||
return ref;
|
return ref;
|
||||||
}
|
}
|
||||||
@ -734,10 +738,19 @@ HTMLWindow *HTMLWindow_Create(HTMLDocument *doc)
|
|||||||
ERR("GetContentDOMWindow failed: %08x\n", nsres);
|
ERR("GetContentDOMWindow failed: %08x\n", nsres);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
list_add_head(&window_list, &ret->entry);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
HTMLWindow *nswindow_to_window(nsIDOMWindow *nswindow)
|
HTMLWindow *nswindow_to_window(nsIDOMWindow *nswindow)
|
||||||
{
|
{
|
||||||
|
HTMLWindow *iter;
|
||||||
|
|
||||||
|
LIST_FOR_EACH_ENTRY(iter, &window_list, HTMLWindow, entry) {
|
||||||
|
if(iter->nswindow == nswindow)
|
||||||
|
return iter;
|
||||||
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,8 @@
|
|||||||
#include "mshtmhst.h"
|
#include "mshtmhst.h"
|
||||||
#include "hlink.h"
|
#include "hlink.h"
|
||||||
|
|
||||||
|
#include "wine/list.h"
|
||||||
|
|
||||||
#ifdef INIT_GUID
|
#ifdef INIT_GUID
|
||||||
#include "initguid.h"
|
#include "initguid.h"
|
||||||
#endif
|
#endif
|
||||||
@ -59,6 +61,8 @@ typedef struct {
|
|||||||
|
|
||||||
HTMLDocument *doc;
|
HTMLDocument *doc;
|
||||||
nsIDOMWindow *nswindow;
|
nsIDOMWindow *nswindow;
|
||||||
|
|
||||||
|
struct list entry;
|
||||||
} HTMLWindow;
|
} HTMLWindow;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -146,8 +146,22 @@ static nsrefcnt NSAPI nsPromptService_Release(nsIPromptService *iface)
|
|||||||
static nsresult NSAPI nsPromptService_Alert(nsIPromptService *iface, nsIDOMWindow *aParent,
|
static nsresult NSAPI nsPromptService_Alert(nsIPromptService *iface, nsIDOMWindow *aParent,
|
||||||
const PRUnichar *aDialogTitle, const PRUnichar *aText)
|
const PRUnichar *aDialogTitle, const PRUnichar *aText)
|
||||||
{
|
{
|
||||||
FIXME("(%p %s %s)\n", aParent, debugstr_w(aDialogTitle), debugstr_w(aText));
|
HTMLWindow *window;
|
||||||
return NS_ERROR_NOT_IMPLEMENTED;
|
BSTR text;
|
||||||
|
|
||||||
|
TRACE("(%p %s %s)\n", aParent, debugstr_w(aDialogTitle), debugstr_w(aText));
|
||||||
|
|
||||||
|
window = nswindow_to_window(aParent);
|
||||||
|
if(!window) {
|
||||||
|
WARN("Could not find HTMLWindow for nsIDOMWindow %p\n", aParent);
|
||||||
|
return NS_ERROR_UNEXPECTED;
|
||||||
|
}
|
||||||
|
|
||||||
|
text = SysAllocString(aText);
|
||||||
|
IHTMLWindow2_alert(HTMLWINDOW2(window), text);
|
||||||
|
SysFreeString(text);
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static nsresult NSAPI nsPromptService_AlertCheck(nsIPromptService *iface,
|
static nsresult NSAPI nsPromptService_AlertCheck(nsIPromptService *iface,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user