Commit afa527c1 authored by Jacek Caban's avatar Jacek Caban Committed by Alexandre Julliard

mshtml: Pass IUri to create_doc_uri.

parent 0e53cfb3
......@@ -108,9 +108,9 @@ HRESULT create_redirect_nschannel(const WCHAR*,nsChannel*,nsChannel**) DECLSPEC_
nsresult on_start_uri_open(NSContainer*,nsIURI*,cpp_bool*) DECLSPEC_HIDDEN;
HRESULT hlink_frame_navigate(HTMLDocument*,LPCWSTR,nsChannel*,DWORD,BOOL*) DECLSPEC_HIDDEN;
HRESULT create_doc_uri(HTMLOuterWindow*,const WCHAR*,nsWineURI**) DECLSPEC_HIDDEN;
HRESULT create_doc_uri(HTMLOuterWindow*,IUri*,nsWineURI**) DECLSPEC_HIDDEN;
HRESULT load_nsuri(HTMLOuterWindow*,nsWineURI*,nsChannelBSC*,DWORD) DECLSPEC_HIDDEN;
HRESULT set_moniker(HTMLDocument*,IMoniker*,IBindCtx*,nsChannelBSC*,BOOL) DECLSPEC_HIDDEN;
HRESULT set_moniker(HTMLDocument*,IMoniker*,IUri*,IBindCtx*,nsChannelBSC*,BOOL) DECLSPEC_HIDDEN;
void prepare_for_binding(HTMLDocument*,IMoniker*,DWORD) DECLSPEC_HIDDEN;
HRESULT super_navigate(HTMLOuterWindow*,IUri*,DWORD,const WCHAR*,BYTE*,DWORD) DECLSPEC_HIDDEN;
HRESULT load_uri(HTMLOuterWindow*,IUri*,DWORD) DECLSPEC_HIDDEN;
......
......@@ -1954,7 +1954,7 @@ static void navigate_proc(task_t *_task)
navigate_task_t *task = (navigate_task_t*)_task;
HRESULT hres;
hres = set_moniker(&task->window->doc_obj->basedoc, task->mon, NULL, task->bscallback, TRUE);
hres = set_moniker(&task->window->doc_obj->basedoc, task->mon, task->uri, NULL, task->bscallback, TRUE);
if(SUCCEEDED(hres)) {
set_current_mon(task->window, task->bscallback->bsc.mon, task->flags);
set_current_uri(task->window, task->uri);
......@@ -2266,6 +2266,8 @@ static HRESULT navigate_uri(HTMLOuterWindow *window, IUri *uri, const WCHAR *dis
nsWineURI *nsuri;
HRESULT hres;
TRACE("%s\n", debugstr_w(display_uri));
if(window->doc_obj && window->doc_obj->is_webbrowser && window == window->doc_obj->basedoc.window) {
if(!(flags & BINDING_REFRESH)) {
BOOL cancel = FALSE;
......@@ -2294,7 +2296,7 @@ static HRESULT navigate_uri(HTMLOuterWindow *window, IUri *uri, const WCHAR *dis
}
}
hres = create_doc_uri(window, display_uri, &nsuri);
hres = create_doc_uri(window, uri, &nsuri);
if(FAILED(hres))
return hres;
......
......@@ -2917,19 +2917,12 @@ static nsresult create_nsuri(IUri *iuri, HTMLOuterWindow *window, NSContainer *c
return NS_OK;
}
HRESULT create_doc_uri(HTMLOuterWindow *window, const WCHAR *url, nsWineURI **ret)
HRESULT create_doc_uri(HTMLOuterWindow *window, IUri *iuri, nsWineURI **ret)
{
nsWineURI *uri;
IUri *iuri;
nsresult nsres;
HRESULT hres;
hres = create_uri(url, 0, &iuri);
if(FAILED(hres))
return hres;
nsres = create_nsuri(iuri, window, window->doc_obj->nscontainer, NULL, &uri);
IUri_Release(iuri);
if(NS_FAILED(nsres))
return E_FAIL;
......
......@@ -349,12 +349,13 @@ void prepare_for_binding(HTMLDocument *This, IMoniker *mon, DWORD flags)
}
}
HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, nsChannelBSC *async_bsc, BOOL set_download)
HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IUri *nav_uri, IBindCtx *pibc, nsChannelBSC *async_bsc, BOOL set_download)
{
download_proc_task_t *download_task;
nsChannelBSC *bscallback;
nsWineURI *nsuri;
LPOLESTR url;
IUri *uri;
HRESULT hres;
hres = IMoniker_GetDisplayName(mon, pibc, NULL, &url);
......@@ -363,11 +364,23 @@ HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, nsChannel
return hres;
}
if(nav_uri) {
uri = nav_uri;
}else {
hres = create_uri(url, 0, &uri);
if(FAILED(hres)) {
CoTaskMemFree(url);
return hres;
}
}
TRACE("got url: %s\n", debugstr_w(url));
set_ready_state(This->window, READYSTATE_LOADING);
hres = create_doc_uri(This->window, url, &nsuri);
hres = create_doc_uri(This->window, uri, &nsuri);
if(!nav_uri)
IUri_Release(uri);
if(SUCCEEDED(hres)) {
if(async_bsc)
bscallback = async_bsc;
......@@ -549,7 +562,7 @@ static HRESULT WINAPI PersistMoniker_Load(IPersistMoniker *iface, BOOL fFullyAva
prepare_for_binding(This, pimkName, FALSE);
call_docview_84(This->doc_obj);
hres = set_moniker(This, pimkName, pibc, NULL, TRUE);
hres = set_moniker(This, pimkName, NULL, pibc, NULL, TRUE);
if(FAILED(hres))
return hres;
......@@ -818,7 +831,7 @@ static HRESULT WINAPI PersistStreamInit_Load(IPersistStreamInit *iface, LPSTREAM
}
prepare_for_binding(This, mon, FALSE);
hres = set_moniker(This, mon, NULL, NULL, TRUE);
hres = set_moniker(This, mon, NULL, NULL, NULL, TRUE);
IMoniker_Release(mon);
if(FAILED(hres))
return hres;
......@@ -875,7 +888,7 @@ static HRESULT WINAPI PersistStreamInit_InitNew(IPersistStreamInit *iface)
}
prepare_for_binding(This, mon, FALSE);
hres = set_moniker(This, mon, NULL, NULL, FALSE);
hres = set_moniker(This, mon, NULL, NULL, NULL, FALSE);
IMoniker_Release(mon);
if(FAILED(hres))
return hres;
......
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