mshtml: Store IWebBrowserApp reference in HTMLDocumentObj.

This commit is contained in:
Jacek Caban 2013-04-15 17:40:43 +02:00 committed by Alexandre Julliard
parent 76234750a5
commit 8f323e9b91
5 changed files with 11 additions and 10 deletions

View File

@ -544,6 +544,7 @@ struct HTMLDocumentObj {
IOleInPlaceUIWindow *ip_window;
IAdviseSink *view_sink;
IDocObjectService *doc_object_service;
IUnknown *webbrowser;
DOCHOSTUIINFO hostinfo;
@ -557,7 +558,6 @@ struct HTMLDocumentObj {
BOOL ui_active;
BOOL window_active;
BOOL hostui_setup;
BOOL is_webbrowser;
BOOL container_locked;
BOOL focus;
BOOL has_popup;

View File

@ -268,7 +268,7 @@ static void parse_complete(HTMLDocumentObj *doc)
call_property_onchanged(&doc->basedoc.cp_container, 1005);
call_explorer_69(doc);
if(doc->is_webbrowser && doc->usermode != EDITMODE && !(doc->basedoc.window->load_flags & BINDING_REFRESH))
if(doc->webbrowser && doc->usermode != EDITMODE && !(doc->basedoc.window->load_flags & BINDING_REFRESH))
IDocObjectService_FireNavigateComplete2(doc->doc_object_service, &doc->basedoc.window->base.IHTMLWindow2_iface, 0);
/* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */

View File

@ -2268,7 +2268,7 @@ static HRESULT navigate_uri(HTMLOuterWindow *window, IUri *uri, const WCHAR *dis
TRACE("%s\n", debugstr_w(display_uri));
if(window->doc_obj && window->doc_obj->is_webbrowser && window == window->doc_obj->basedoc.window) {
if(window->doc_obj && window->doc_obj->webbrowser && window == window->doc_obj->basedoc.window) {
if(!(flags & BINDING_REFRESH)) {
BOOL cancel = FALSE;

View File

@ -246,8 +246,12 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
This->doc_obj->doc_object_service = NULL;
}
if(This->doc_obj->webbrowser) {
IUnknown_Release(This->doc_obj->webbrowser);
This->doc_obj->webbrowser = NULL;
}
memset(&This->doc_obj->hostinfo, 0, sizeof(DOCHOSTUIINFO));
This->doc_obj->is_webbrowser = FALSE;
if(!pClientSite)
return S_OK;
@ -348,11 +352,8 @@ static HRESULT WINAPI OleObject_SetClientSite(IOleObject *iface, IOleClientSite
* embedder supports IWebBrowserApp.
*/
hres = do_query_service((IUnknown*)pClientSite, &IID_IWebBrowserApp, &IID_IWebBrowser2, (void**)&wb);
if(SUCCEEDED(hres)) {
This->doc_obj->is_webbrowser = TRUE;
IWebBrowser2_Release(wb);
}
if(SUCCEEDED(hres))
This->doc_obj->webbrowser = (IUnknown*)wb;
IBrowserService_Release(browser_service);
}
}

View File

@ -77,7 +77,7 @@ static void notify_travellog_update(HTMLDocumentObj *doc)
IOleCommandTarget *cmdtrg;
HRESULT hres;
if(!doc->is_webbrowser)
if(!doc->webbrowser)
return;
hres = IOleClientSite_QueryInterface(doc->client, &IID_IOleCommandTarget, (void**)&cmdtrg);