shdocvw: Added WebBrowser v1 implementation.

This commit is contained in:
Jacek Caban 2006-05-23 20:03:30 +02:00 committed by Alexandre Julliard
parent c0d1f91a7c
commit 86163e7a78
3 changed files with 23 additions and 4 deletions

View File

@ -124,7 +124,8 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
{
HRESULT hres;
static IClassFactoryImpl WBClassFactory = {&WBCF_Vtbl, WebBrowser_Create};
static IClassFactoryImpl WB1ClassFactory = {&WBCF_Vtbl, WebBrowserV1_Create};
static IClassFactoryImpl WB2ClassFactory = {&WBCF_Vtbl, WebBrowserV2_Create};
TRACE("\n");
@ -132,9 +133,13 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
hres = create_mozctl(riid, ppv);
if(SUCCEEDED(hres))
return hres;
return IClassFactory_QueryInterface(FACTORY(&WBClassFactory), riid, ppv);
return IClassFactory_QueryInterface(FACTORY(&WB2ClassFactory), riid, ppv);
}
if(IsEqualGUID(&CLSID_WebBrowser_V1, rclsid))
return IClassFactory_QueryInterface(FACTORY(&WB1ClassFactory), riid, ppv);
/* As a last resort, figure if the CLSID belongs to a 'Shell Instance Object' */
return SHDOCVW_GetShellInstanceObjectClassObject(rclsid, riid, ppv);
}

View File

@ -104,6 +104,8 @@ typedef struct {
LONG ref;
INT version;
IOleClientSite *client;
IOleContainer *container;
IOleInPlaceSite *inplace;
@ -182,7 +184,8 @@ void DocHost_ClientSite_Release(DocHost*);
void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*);
void ConnectionPointContainer_Destroy(ConnectionPointContainer*);
HRESULT WebBrowser_Create(IUnknown*,REFIID,void**);
HRESULT WebBrowserV1_Create(IUnknown*,REFIID,void**);
HRESULT WebBrowserV2_Create(IUnknown*,REFIID,void**);
void create_doc_view_hwnd(DocHost*);
void deactivate_document(DocHost*);

View File

@ -918,7 +918,7 @@ static const IWebBrowser2Vtbl WebBrowser2Vtbl =
WebBrowser_put_Resizable
};
HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv)
static HRESULT WebBrowser_Create(INT version, IUnknown *pOuter, REFIID riid, void **ppv)
{
WebBrowser *ret;
HRESULT hres;
@ -929,6 +929,7 @@ HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv)
ret->lpWebBrowser2Vtbl = &WebBrowser2Vtbl;
ret->ref = 0;
ret->version = version;
DocHost_Init(&ret->doc_host, (IDispatch*)WEBBROWSER2(ret));
@ -954,3 +955,13 @@ HRESULT WebBrowser_Create(IUnknown *pOuter, REFIID riid, void **ppv)
return hres;
}
HRESULT WebBrowserV1_Create(IUnknown *pOuter, REFIID riid, void **ppv)
{
return WebBrowser_Create(1, pOuter, riid, ppv);
}
HRESULT WebBrowserV2_Create(IUnknown *pOuter, REFIID riid, void **ppv)
{
return WebBrowser_Create(2, pOuter, riid, ppv);
}