Commit 87e04f2f authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

shdocvw: Added get_LocationURL implementation.

parent d6d76870
...@@ -315,7 +315,7 @@ static IBindStatusCallback *create_callback(WebBrowser *This, PBYTE post_data, ...@@ -315,7 +315,7 @@ static IBindStatusCallback *create_callback(WebBrowser *This, PBYTE post_data,
return BINDSC(ret); return BINDSC(ret);
} }
static void on_before_navigate2(WebBrowser *This, PBYTE post_data, ULONG post_data_len, static void on_before_navigate2(WebBrowser *This, LPWSTR url, PBYTE post_data, ULONG post_data_len,
LPWSTR headers, VARIANT_BOOL *cancel) LPWSTR headers, VARIANT_BOOL *cancel)
{ {
VARIANT var_url, var_flags, var_frame_name, var_post_data, var_post_data2, var_headers; VARIANT var_url, var_flags, var_frame_name, var_post_data, var_post_data2, var_headers;
...@@ -366,13 +366,14 @@ static void on_before_navigate2(WebBrowser *This, PBYTE post_data, ULONG post_da ...@@ -366,13 +366,14 @@ static void on_before_navigate2(WebBrowser *This, PBYTE post_data, ULONG post_da
V_VT(params+5) = (VT_BYREF|VT_VARIANT); V_VT(params+5) = (VT_BYREF|VT_VARIANT);
V_VARIANTREF(params+5) = &var_url; V_VARIANTREF(params+5) = &var_url;
V_VT(&var_url) = VT_BSTR; V_VT(&var_url) = VT_BSTR;
V_BSTR(&var_url) = SysAllocString(This->url); V_BSTR(&var_url) = SysAllocString(url);
V_VT(params+6) = (VT_DISPATCH); V_VT(params+6) = (VT_DISPATCH);
V_DISPATCH(params+6) = (IDispatch*)WEBBROWSER2(This); V_DISPATCH(params+6) = (IDispatch*)WEBBROWSER2(This);
call_sink(This->cp_wbe2, DISPID_BEFORENAVIGATE2, &dispparams); call_sink(This->cp_wbe2, DISPID_BEFORENAVIGATE2, &dispparams);
SysFreeString(V_BSTR(&var_url));
if(post_data_len) if(post_data_len)
SafeArrayDestroy(V_ARRAY(&var_post_data)); SafeArrayDestroy(V_ARRAY(&var_post_data));
} }
...@@ -472,6 +473,7 @@ HRESULT navigate_hlink(WebBrowser *This, IMoniker *mon, IBindCtx *bindctx, ...@@ -472,6 +473,7 @@ HRESULT navigate_hlink(WebBrowser *This, IMoniker *mon, IBindCtx *bindctx,
IBindStatusCallback *callback) IBindStatusCallback *callback)
{ {
IHttpNegotiate *http_negotiate; IHttpNegotiate *http_negotiate;
LPWSTR url = NULL;
PBYTE post_data = NULL; PBYTE post_data = NULL;
ULONG post_data_len = 0; ULONG post_data_len = 0;
LPWSTR headers = NULL; LPWSTR headers = NULL;
...@@ -480,8 +482,8 @@ HRESULT navigate_hlink(WebBrowser *This, IMoniker *mon, IBindCtx *bindctx, ...@@ -480,8 +482,8 @@ HRESULT navigate_hlink(WebBrowser *This, IMoniker *mon, IBindCtx *bindctx,
DWORD bindf = 0; DWORD bindf = 0;
HRESULT hres; HRESULT hres;
IMoniker_GetDisplayName(mon, NULL, NULL, &This->url); IMoniker_GetDisplayName(mon, NULL, NULL, &url);
TRACE("navigating to %s\n", debugstr_w(This->url)); TRACE("navigating to %s\n", debugstr_w(url));
hres = IBindStatusCallback_QueryInterface(callback, &IID_IHttpNegotiate, hres = IBindStatusCallback_QueryInterface(callback, &IID_IHttpNegotiate,
(void**)&http_negotiate); (void**)&http_negotiate);
...@@ -504,16 +506,19 @@ HRESULT navigate_hlink(WebBrowser *This, IMoniker *mon, IBindCtx *bindctx, ...@@ -504,16 +506,19 @@ HRESULT navigate_hlink(WebBrowser *This, IMoniker *mon, IBindCtx *bindctx,
post_data = bindinfo.stgmedData.u.hGlobal; post_data = bindinfo.stgmedData.u.hGlobal;
} }
on_before_navigate2(This, post_data, post_data_len, headers, &cancel); on_before_navigate2(This, url, post_data, post_data_len, headers, &cancel);
CoTaskMemFree(headers); CoTaskMemFree(headers);
ReleaseBindInfo(&bindinfo); ReleaseBindInfo(&bindinfo);
if(cancel) { if(cancel) {
FIXME("navigation canceled\n"); FIXME("navigation canceled\n");
CoTaskMemFree(url);
return S_OK; return S_OK;
} }
This->url = url;
return navigate(This, mon, bindctx, callback); return navigate(This, mon, bindctx, callback);
} }
......
...@@ -351,8 +351,17 @@ static HRESULT WINAPI WebBrowser_get_LocationName(IWebBrowser2 *iface, BSTR *Loc ...@@ -351,8 +351,17 @@ static HRESULT WINAPI WebBrowser_get_LocationName(IWebBrowser2 *iface, BSTR *Loc
static HRESULT WINAPI WebBrowser_get_LocationURL(IWebBrowser2 *iface, BSTR *LocationURL) static HRESULT WINAPI WebBrowser_get_LocationURL(IWebBrowser2 *iface, BSTR *LocationURL)
{ {
WebBrowser *This = WEBBROWSER_THIS(iface); WebBrowser *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%p)\n", This, LocationURL); FIXME("(%p)->(%p)\n", This, LocationURL);
return E_NOTIMPL;
if(!This->url) {
static const WCHAR null_char = 0;
*LocationURL = SysAllocString(&null_char);
return S_FALSE;
}
*LocationURL = SysAllocString(This->url);
return S_OK;
} }
static HRESULT WINAPI WebBrowser_get_Busy(IWebBrowser2 *iface, VARIANT_BOOL *pBool) static HRESULT WINAPI WebBrowser_get_Busy(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
...@@ -543,7 +552,7 @@ static HRESULT WINAPI WebBrowser_Navigate2(IWebBrowser2 *iface, VARIANT *URL, VA ...@@ -543,7 +552,7 @@ static HRESULT WINAPI WebBrowser_Navigate2(IWebBrowser2 *iface, VARIANT *URL, VA
return E_INVALIDARG; return E_INVALIDARG;
headers = V_BSTR(Headers); headers = V_BSTR(Headers);
FIXME("Headers: %s\n", debugstr_w(headers)); TRACE("Headers: %s\n", debugstr_w(headers));
} }
if(!This->doc_view_hwnd) if(!This->doc_view_hwnd)
......
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