예제 #1
0
파일: navigate.c 프로젝트: mikekap/wine
static void doc_navigate_proc(DocHost *This, task_header_t *t)
{
    task_doc_navigate_t *task = (task_doc_navigate_t*)t;
    IHTMLPrivateWindow *priv_window;
    HRESULT hres;

    if(!This->doc_navigate)
        return;

    if(task->async_notif) {
        VARIANT_BOOL cancel = VARIANT_FALSE;
        on_before_navigate2(This, task->url, task->post_data, task->headers, &cancel);
        if(cancel) {
            TRACE("Navigation calnceled\n");
            free_doc_navigate_task(task, FALSE);
            return;
        }
    }

    hres = IUnknown_QueryInterface(This->doc_navigate, &IID_IHTMLPrivateWindow, (void**)&priv_window);
    if(SUCCEEDED(hres)) {
        html_window_navigate(This, priv_window, task->url, task->headers, task->post_data);
        IHTMLPrivateWindow_Release(priv_window);
    }else {
        WARN("Could not get IHTMLPrivateWindow iface: %08x\n", hres);
    }

    free_doc_navigate_task(task, FALSE);
}
예제 #2
0
static HRESULT WINAPI DocObjectService_FireNavigateComplete2(
        IDocObjectService* iface,
        IHTMLWindow2 *pHTMLWindow2,
        DWORD dwFlags)
{
    ShellBrowser *This = impl_from_IDocObjectService(iface);
    DocHost *doc_host = This->doc_host;
    IHTMLPrivateWindow *priv_window;
    VARIANTARG params[2];
    DISPPARAMS dp = {params, NULL, 2, 0};
    VARIANT url_var;
    BSTR url;
    HRESULT hres;

    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;
        doc_host->travellog.loading_pos = -1;
    }

    hres = IHTMLWindow2_QueryInterface(pHTMLWindow2, &IID_IHTMLPrivateWindow, (void**)&priv_window);
    if(FAILED(hres))
        return hres;

    hres = IHTMLPrivateWindow_GetAddressBarUrl(priv_window, &url);
    IHTMLPrivateWindow_Release(priv_window);
    if(FAILED(hres))
        return hres;

    TRACE("got URL %s\n", debugstr_w(url));
    set_dochost_url(This->doc_host, url);

    V_VT(params) = (VT_BYREF|VT_VARIANT);
    V_VARIANTREF(params) = &url_var;

    V_VT(params+1) = VT_DISPATCH;
    V_DISPATCH(params+1) = (IDispatch*)doc_host->wb;

    V_VT(&url_var) = VT_BSTR;
    V_BSTR(&url_var) = url;

    /* Keep reference to This. It may be released in event handler. */
    IShellBrowser_AddRef(&This->IShellBrowser_iface);

    TRACE(">>>\n");
    call_sink(This->doc_host->cps.wbe2, DISPID_NAVIGATECOMPLETE2, &dp);
    TRACE("<<<\n");

    SysFreeString(url);

    This->doc_host->busy = VARIANT_FALSE;
    IShellBrowser_Release(&This->IShellBrowser_iface);
    return S_OK;
}
예제 #3
0
static HRESULT WINAPI DocObjectService_FireDocumentComplete(
        IDocObjectService* iface,
        IHTMLWindow2 *pHTMLWindow,
        DWORD dwFlags)
{
    ShellBrowser *This = impl_from_IDocObjectService(iface);
    IHTMLPrivateWindow *priv_window;
    VARIANTARG params[2];
    DISPPARAMS dp = {params, NULL, 2, 0};
    VARIANT url_var;
    BSTR url;
    HRESULT hres;

    TRACE("%p %p %x\n", This, pHTMLWindow, dwFlags);

    hres = IHTMLWindow2_QueryInterface(pHTMLWindow, &IID_IHTMLPrivateWindow, (void**)&priv_window);
    if(FAILED(hres))
        return hres;

    hres = IHTMLPrivateWindow_GetAddressBarUrl(priv_window, &url);
    IHTMLPrivateWindow_Release(priv_window);
    if(FAILED(hres))
        return hres;

    TRACE("got URL %s\n", debugstr_w(url));

    V_VT(params) = (VT_BYREF|VT_VARIANT);
    V_VARIANTREF(params) = &url_var;

    V_VT(params+1) = VT_DISPATCH;
    V_DISPATCH(params+1) = (IDispatch*)This->doc_host->wb;

    V_VT(&url_var) = VT_BSTR;
    V_BSTR(&url_var) = url;

    /* Keep reference to This. It may be released in event handler. */
    IShellBrowser_AddRef(&This->IShellBrowser_iface);

    TRACE(">>>\n");
    call_sink(This->doc_host->cps.wbe2, DISPID_DOCUMENTCOMPLETE, &dp);
    TRACE("<<<\n");

    SysFreeString(url);
    if(This->doc_host)
        This->doc_host->busy = VARIANT_FALSE;

    IShellBrowser_Release(&This->IShellBrowser_iface);
    return S_OK;
}
예제 #4
0
static HRESULT WINAPI DocObjectService_FireNavigateComplete2(
        IDocObjectService* iface,
        IHTMLWindow2 *pHTMLWindow2,
        DWORD dwFlags)
{
    ShellBrowser *This = impl_from_IDocObjectService(iface);
    IHTMLPrivateWindow *priv_window;
    VARIANTARG params[2];
    DISPPARAMS dp = {params, NULL, 2, 0};
    VARIANT url_var;
    BSTR url;
    HRESULT hres;

    TRACE("%p %p %x\n", This, pHTMLWindow2, dwFlags);

    hres = IHTMLWindow2_QueryInterface(pHTMLWindow2, &IID_IHTMLPrivateWindow, (void**)&priv_window);
    if(FAILED(hres))
        return hres;

    hres = IHTMLPrivateWindow_GetAddressBarUrl(priv_window, &url);
    IHTMLPrivateWindow_Release(priv_window);
    if(FAILED(hres))
        return hres;

    TRACE("got URL %s\n", debugstr_w(url));
    set_dochost_url(This->doc_host, url);

    V_VT(params) = (VT_BYREF|VT_VARIANT);
    V_BYREF(params) = &url;

    V_VT(params+1) = VT_DISPATCH;
    V_DISPATCH(params+1) = This->doc_host->disp;

    V_VT(&url_var) = VT_BSTR;
    V_BSTR(&url_var) = url;

    TRACE(">>>\n");
    call_sink(This->doc_host->cps.wbe2, DISPID_NAVIGATECOMPLETE2, &dp);
    TRACE("<<<\n");

    SysFreeString(url);

    This->doc_host->busy = VARIANT_FALSE;
    return S_OK;
}