Commit 9cbe52b1 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

shdocvw: Store IDocHostUIHandler interface in the WebBrowser object.

parent 1de825f7
/*
* Copyright 2005 Jacek Caban for CodeWeavers
* Copyright 2005-2006 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -239,19 +239,14 @@ static HRESULT WINAPI DocHostUIHandler_GetHostInfo(IDocHostUIHandler2 *iface,
DOCHOSTUIINFO *pInfo)
{
WebBrowser *This = DOCHOSTUI_THIS(iface);
IDocHostUIHandler *handler;
HRESULT hres;
TRACE("(%p)->(%p)\n", This, pInfo);
if(This->client) {
hres = IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler, (void**)&handler);
if(SUCCEEDED(hres)) {
hres = IDocHostUIHandler_GetHostInfo(handler, pInfo);
IDocHostUIHandler_Release(handler);
if(SUCCEEDED(hres))
return hres;
}
if(This->hostui) {
hres = IDocHostUIHandler_GetHostInfo(This->hostui, pInfo);
if(SUCCEEDED(hres))
return hres;
}
pInfo->dwFlags = DOCHOSTUIFLAG_DISABLE_HELP_MENU | DOCHOSTUIFLAG_OPENNEWWIN
......@@ -328,21 +323,11 @@ static HRESULT WINAPI DocHostUIHandler_GetOptionKeyPath(IDocHostUIHandler2 *ifac
LPOLESTR *pchKey, DWORD dw)
{
WebBrowser *This = DOCHOSTUI_THIS(iface);
IDocHostUIHandler *handler;
HRESULT hres;
TRACE("(%p)->(%p %ld)\n", This, pchKey, dw);
if(!This->client)
return S_OK;
hres = IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler,
(void**)&handler);
if(SUCCEEDED(hres)) {
hres = IDocHostUIHandler_GetOptionKeyPath(handler, pchKey, dw);
IDocHostUIHandler_Release(handler);
return hres;
}
if(This->hostui)
return IDocHostUIHandler_GetOptionKeyPath(This->hostui, pchKey, dw);
return S_OK;
}
......@@ -430,5 +415,7 @@ void WebBrowser_DocHost_Init(WebBrowser *This)
{
This->lpDocHostUIHandlerVtbl = &DocHostUIHandler2Vtbl;
This->hostui = NULL;
This->doc_view_hwnd = NULL;
}
......@@ -124,6 +124,7 @@ static ULONG WINAPI OleObject_Release(IOleObject *iface)
static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE pClientSite)
{
WebBrowser *This = OLEOBJ_THIS(iface);
HRESULT hres;
TRACE("(%p)->(%p)\n", This, pClientSite);
......@@ -139,6 +140,8 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE
This->shell_embedding_hwnd = NULL;
}
if(This->hostui)
IDocHostUIHandler_Release(This->hostui);
if(This->client)
IOleClientSite_Release(This->client);
......@@ -152,6 +155,11 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, LPOLECLIENTSITE
This->client = pClientSite;
IOleClientSite_AddRef(pClientSite);
hres = IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler,
(void**)&This->hostui);
if(FAILED(hres))
This->hostui = NULL;
create_shell_embedding_hwnd(This);
return S_OK;
......
......@@ -2,6 +2,7 @@
* Header includes for shdocvw.dll
*
* Copyright 2001 John R. Sheets (for CodeWeavers)
* Copyright 2005-2006 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -94,6 +95,7 @@ typedef struct {
IOleClientSite *client;
IOleContainer *container;
IOleDocumentView *view;
IDocHostUIHandler *hostui;
LPOLESTR url;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment