mshtml: Use flags in navigation functions.

This commit is contained in:
Jacek Caban 2012-11-08 18:17:35 +01:00 committed by Alexandre Julliard
parent 92443dca02
commit cfa0a3accd
4 changed files with 18 additions and 15 deletions

View File

@ -98,6 +98,9 @@ typedef struct {
WCHAR *data;
} http_header_t;
#define BINDING_NAVIGATED 0x0001
#define BINDING_REPLACE 0x0002
HRESULT set_http_header(struct list*,const WCHAR*,int,const WCHAR*,int) DECLSPEC_HIDDEN;
HRESULT create_redirect_nschannel(const WCHAR*,nsChannel*,nsChannel**) DECLSPEC_HIDDEN;
@ -106,8 +109,8 @@ HRESULT hlink_frame_navigate(HTMLDocument*,LPCWSTR,nsChannel*,DWORD,BOOL*) DECLS
HRESULT create_doc_uri(HTMLOuterWindow*,const WCHAR*,nsWineURI**) DECLSPEC_HIDDEN;
HRESULT load_nsuri(HTMLOuterWindow*,nsWineURI*,nsChannelBSC*,DWORD) DECLSPEC_HIDDEN;
HRESULT set_moniker(HTMLDocument*,IMoniker*,IBindCtx*,nsChannelBSC*,BOOL) DECLSPEC_HIDDEN;
void prepare_for_binding(HTMLDocument*,IMoniker*,BOOL) DECLSPEC_HIDDEN;
HRESULT super_navigate(HTMLOuterWindow*,IUri*,const WCHAR*,BYTE*,DWORD) DECLSPEC_HIDDEN;
void prepare_for_binding(HTMLDocument*,IMoniker*,DWORD) DECLSPEC_HIDDEN;
HRESULT super_navigate(HTMLOuterWindow*,IUri*,DWORD,const WCHAR*,BYTE*,DWORD) DECLSPEC_HIDDEN;
HRESULT navigate_new_window(HTMLOuterWindow*,IUri*,const WCHAR*,IHTMLWindow2**) DECLSPEC_HIDDEN;
HRESULT create_channelbsc(IMoniker*,const WCHAR*,BYTE*,DWORD,BOOL,nsChannelBSC**) DECLSPEC_HIDDEN;

View File

@ -2098,7 +2098,7 @@ static HRESULT WINAPI HTMLPrivateWindow_SuperNavigate(IHTMLPrivateWindow *iface,
headers = V_BSTR(headers_var);
}
hres = super_navigate(window, uri, headers, post_data, post_data_size);
hres = super_navigate(window, uri, BINDING_NAVIGATED, headers, post_data, post_data_size);
IUri_Release(uri);
if(post_data)
SafeArrayUnaccessData(V_ARRAY(post_data_var));

View File

@ -2044,7 +2044,7 @@ static HRESULT navigate_fragment(HTMLOuterWindow *window, IUri *uri)
return S_OK;
}
HRESULT super_navigate(HTMLOuterWindow *window, IUri *uri, const WCHAR *headers, BYTE *post_data, DWORD post_data_size)
HRESULT super_navigate(HTMLOuterWindow *window, IUri *uri, DWORD flags, const WCHAR *headers, BYTE *post_data, DWORD post_data_size)
{
nsChannelBSC *bsc;
IUri *uri_nofrag;
@ -2104,7 +2104,7 @@ HRESULT super_navigate(HTMLOuterWindow *window, IUri *uri, const WCHAR *headers,
return hres;
}
prepare_for_binding(&window->doc_obj->basedoc, mon, TRUE);
prepare_for_binding(&window->doc_obj->basedoc, mon, flags);
hres = IUri_GetScheme(uri, &scheme);
if(SUCCEEDED(hres) && scheme != URL_SCHEME_JAVASCRIPT) {
@ -2234,7 +2234,7 @@ HRESULT hlink_frame_navigate(HTMLDocument *doc, LPCWSTR url, nsChannel *nschanne
hres = CreateAsyncBindCtx(0, &callback->bsc.IBindStatusCallback_iface, NULL, &bindctx);
if(SUCCEEDED(hres))
hres = CoCreateInstance(&CLSID_StdHlink, NULL, CLSCTX_INPROC_SERVER,
hres = CoCreateInstance(&CLSID_StdHlink, NULL, CLSCTX_INPROC_SERVER,
&IID_IHlink, (LPVOID*)&hlink);
if(SUCCEEDED(hres))
@ -2261,7 +2261,7 @@ HRESULT hlink_frame_navigate(HTMLDocument *doc, LPCWSTR url, nsChannel *nschanne
return hres;
}
static HRESULT navigate_uri(HTMLOuterWindow *window, IUri *uri, const WCHAR *display_uri)
static HRESULT navigate_uri(HTMLOuterWindow *window, IUri *uri, const WCHAR *display_uri, DWORD flags)
{
nsWineURI *nsuri;
HRESULT hres;
@ -2276,7 +2276,7 @@ static HRESULT navigate_uri(HTMLOuterWindow *window, IUri *uri, const WCHAR *dis
return S_OK;
}
return super_navigate(window, uri, NULL, NULL, 0);
return super_navigate(window, uri, flags, NULL, NULL, 0);
}
if(window->doc_obj && window == window->doc_obj->basedoc.window) {
@ -2343,7 +2343,7 @@ HRESULT navigate_url(HTMLOuterWindow *window, const WCHAR *new_url, IUri *base_u
}
}
hres = navigate_uri(window, uri, display_uri);
hres = navigate_uri(window, uri, display_uri, BINDING_NAVIGATED);
IUri_Release(uri);
SysFreeString(display_uri);

View File

@ -292,7 +292,7 @@ static void set_downloading_task_destr(task_t *_task)
heap_free(task);
}
void prepare_for_binding(HTMLDocument *This, IMoniker *mon, BOOL navigated_binding)
void prepare_for_binding(HTMLDocument *This, IMoniker *mon, DWORD flags)
{
HRESULT hres;
@ -332,17 +332,17 @@ void prepare_for_binding(HTMLDocument *This, IMoniker *mon, BOOL navigated_bindi
if(SUCCEEDED(hres)) {
VARIANT var, out;
if(!navigated_binding) {
V_VT(&var) = VT_I4;
V_I4(&var) = 0;
IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 37, 0, &var, NULL);
}else {
if(flags & BINDING_NAVIGATED) {
V_VT(&var) = VT_UNKNOWN;
V_UNKNOWN(&var) = (IUnknown*)&This->window->base.IHTMLWindow2_iface;
V_VT(&out) = VT_EMPTY;
hres = IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 63, 0, &var, &out);
if(SUCCEEDED(hres))
VariantClear(&out);
}else {
V_VT(&var) = VT_I4;
V_I4(&var) = 0;
IOleCommandTarget_Exec(cmdtrg, &CGID_ShellDocView, 37, 0, &var, NULL);
}
IOleCommandTarget_Release(cmdtrg);