shdocvw: Share get_LocationURL implementation between WebBrowser and InternetExplorer objects.

This commit is contained in:
Jacek Caban 2010-12-17 03:28:06 +01:00 committed by Alexandre Julliard
parent a601c75db3
commit 07b6e423d3
4 changed files with 18 additions and 11 deletions

View File

@ -291,8 +291,10 @@ static HRESULT WINAPI InternetExplorer_get_LocationName(IWebBrowser2 *iface, BST
static HRESULT WINAPI InternetExplorer_get_LocationURL(IWebBrowser2 *iface, BSTR *LocationURL)
{
InternetExplorer *This = impl_from_IWebBrowser2(iface);
FIXME("(%p)->(%p)\n", This, LocationURL);
return E_NOTIMPL;
TRACE("(%p)->(%p)\n", This, LocationURL);
return get_location_url(&This->doc_host, LocationURL);
}
static HRESULT WINAPI InternetExplorer_get_Busy(IWebBrowser2 *iface, VARIANT_BOOL *pBool)

View File

@ -880,6 +880,17 @@ HRESULT go_home(DocHost *This)
return navigate_url(This, wszPageName, NULL, NULL, NULL, NULL);
}
HRESULT get_location_url(DocHost *This, BSTR *ret)
{
FIXME("semi-stub\n");
*ret = This->url ? SysAllocString(This->url) : SysAllocStringLen(NULL, 0);
if(!*ret)
return E_OUTOFMEMORY;
return This->url ? S_OK : S_FALSE;
}
static inline HlinkFrame *impl_from_IHlinkFrame(IHlinkFrame *iface)
{
return CONTAINING_RECORD(iface, HlinkFrame, IHlinkFrame_iface);

View File

@ -226,6 +226,7 @@ void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*);
HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VARIANT*);
HRESULT go_home(DocHost*);
void set_doc_state(DocHost*,READYSTATE);
HRESULT get_location_url(DocHost*,BSTR*);
#define WM_DOCHOSTTASK (WM_USER+0x300)
void push_dochost_task(DocHost*,task_header_t*,task_proc_t,BOOL);

View File

@ -501,16 +501,9 @@ static HRESULT WINAPI WebBrowser_get_LocationURL(IWebBrowser2 *iface, BSTR *Loca
{
WebBrowser *This = impl_from_IWebBrowser2(iface);
FIXME("(%p)->(%p)\n", This, LocationURL);
TRACE("(%p)->(%p)\n", This, LocationURL);
if(!This->doc_host.url) {
static const WCHAR null_char = 0;
*LocationURL = SysAllocString(&null_char);
return S_FALSE;
}
*LocationURL = SysAllocString(This->doc_host.url);
return S_OK;
return get_location_url(&This->doc_host, LocationURL);
}
static HRESULT WINAPI WebBrowser_get_Busy(IWebBrowser2 *iface, VARIANT_BOOL *pBool)