ieframe: Update back/forward command state in FireNavigateComplete2.

This commit is contained in:
Jacek Caban 2015-08-18 14:01:01 +02:00 committed by Alexandre Julliard
parent 16bfe07639
commit 670459b7bc
4 changed files with 32 additions and 21 deletions

View File

@ -80,6 +80,35 @@ void abort_dochost_tasks(DocHost *This, task_proc_t proc)
}
}
void on_commandstate_change(DocHost *doc_host, LONG command, VARIANT_BOOL enable)
{
DISPPARAMS dispparams;
VARIANTARG params[2];
TRACE("command=%d enable=%d\n", command, enable);
dispparams.cArgs = 2;
dispparams.cNamedArgs = 0;
dispparams.rgdispidNamedArgs = NULL;
dispparams.rgvarg = params;
V_VT(params) = VT_BOOL;
V_BOOL(params) = enable;
V_VT(params+1) = VT_I4;
V_I4(params+1) = command;
call_sink(doc_host->cps.wbe2, DISPID_COMMANDSTATECHANGE, &dispparams);
}
void update_navigation_commands(DocHost *dochost)
{
unsigned pos = dochost->travellog.loading_pos == -1 ? dochost->travellog.position : dochost->travellog.loading_pos;
on_commandstate_change(dochost, CSC_NAVIGATEBACK, pos > 0 ? VARIANT_TRUE : VARIANT_FALSE);
on_commandstate_change(dochost, CSC_NAVIGATEFORWARD, pos < dochost->travellog.length ? VARIANT_TRUE : VARIANT_FALSE);
}
static void notif_complete(DocHost *This, DISPID dispid)
{
DISPPARAMS dispparams;

View File

@ -278,6 +278,7 @@ void deactivate_document(DocHost*) DECLSPEC_HIDDEN;
void create_doc_view_hwnd(DocHost*) DECLSPEC_HIDDEN;
void on_commandstate_change(DocHost*,LONG,VARIANT_BOOL) DECLSPEC_HIDDEN;
void notify_download_state(DocHost*,BOOL) DECLSPEC_HIDDEN;
void update_navigation_commands(DocHost *dochost) DECLSPEC_HIDDEN;
#define WM_DOCHOSTTASK (WM_USER+0x300)
void push_dochost_task(DocHost*,task_header_t*,task_proc_t,task_destr_t,BOOL) DECLSPEC_HIDDEN;

View File

@ -781,27 +781,6 @@ static void doc_navigate_task_destr(task_header_t *t)
heap_free(task);
}
void on_commandstate_change(DocHost *doc_host, LONG command, VARIANT_BOOL enable)
{
DISPPARAMS dispparams;
VARIANTARG params[2];
TRACE("command=%d enable=%d\n", command, enable);
dispparams.cArgs = 2;
dispparams.cNamedArgs = 0;
dispparams.rgdispidNamedArgs = NULL;
dispparams.rgvarg = params;
V_VT(params) = VT_BOOL;
V_BOOL(params) = enable;
V_VT(params+1) = VT_I4;
V_I4(params+1) = command;
call_sink(doc_host->cps.wbe2, DISPID_COMMANDSTATECHANGE, &dispparams);
}
static void doc_navigate_proc(DocHost *This, task_header_t *t)
{
task_doc_navigate_t *task = (task_doc_navigate_t*)t;

View File

@ -748,6 +748,8 @@ static HRESULT WINAPI DocObjectService_FireNavigateComplete2(
TRACE("%p %p %x\n", This, pHTMLWindow2, dwFlags);
update_navigation_commands(This->doc_host);
if(doc_host->travellog.loading_pos != -1) {
WARN("histupdate not notified\n");
doc_host->travellog.position = doc_host->travellog.loading_pos;