bug 367519. r=bsmedberg. add XUL and SVG mime type support to the mozilla activex control. Also updated some deprecated ATL macros.

This commit is contained in:
mark.finkle@gmail.com 2007-05-16 19:19:50 -07:00
Родитель 80fa4c32e6
Коммит c520950780
3 изменённых файлов: 63 добавлений и 16 удалений

Просмотреть файл

@ -454,6 +454,13 @@ LRESULT CMozillaBrowser::OnCreate(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL&
} }
} }
} }
else
{
if (mInitialSrc.Length() > 0)
{
Navigate(mInitialSrc, NULL, NULL, NULL, NULL);
}
}
} }
// Clip the child windows out of paint operations // Clip the child windows out of paint operations
@ -1911,7 +1918,6 @@ HRESULT STDMETHODCALLTYPE CMozillaBrowser::put_RegisterAsDropTarget(VARIANT_BOOL
return S_OK; return S_OK;
} }
/////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////
// Ole Command Handlers // Ole Command Handlers

Просмотреть файл

@ -82,6 +82,7 @@ class ATL_NO_VTABLE CMozillaBrowser :
public IProvideClassInfo2Impl<&CLSID_MozillaBrowser, &DIID_DWebBrowserEvents2, &LIBID_MOZILLACONTROLLib>, public IProvideClassInfo2Impl<&CLSID_MozillaBrowser, &DIID_DWebBrowserEvents2, &LIBID_MOZILLACONTROLLib>,
public IPersistStreamInitImpl<CMozillaBrowser>, public IPersistStreamInitImpl<CMozillaBrowser>,
public IPersistStorageImpl<CMozillaBrowser>, public IPersistStorageImpl<CMozillaBrowser>,
public IPersistPropertyBagImpl<CMozillaBrowser>,
public IQuickActivateImpl<CMozillaBrowser>, public IQuickActivateImpl<CMozillaBrowser>,
public IOleControlImpl<CMozillaBrowser>, public IOleControlImpl<CMozillaBrowser>,
public IOleObjectImpl<CMozillaBrowser>, public IOleObjectImpl<CMozillaBrowser>,
@ -93,6 +94,7 @@ class ATL_NO_VTABLE CMozillaBrowser :
public IOleCommandTargetImpl<CMozillaBrowser>, public IOleCommandTargetImpl<CMozillaBrowser>,
public IConnectionPointContainerImpl<CMozillaBrowser>, public IConnectionPointContainerImpl<CMozillaBrowser>,
public ISpecifyPropertyPagesImpl<CMozillaBrowser>, public ISpecifyPropertyPagesImpl<CMozillaBrowser>,
public IObjectSafetyImpl<CMozillaBrowser, INTERFACESAFE_FOR_UNTRUSTED_CALLER | INTERFACESAFE_FOR_UNTRUSTED_DATA>,
public IMozControlBridge public IMozControlBridge
{ {
friend CWebBrowserContainer; friend CWebBrowserContainer;
@ -118,24 +120,27 @@ BEGIN_COM_MAP(CMozillaBrowser)
COM_INTERFACE_ENTRY_IID(DIID_DWebBrowserEvents2, COM_INTERFACE_ENTRY_IID(DIID_DWebBrowserEvents2,
CProxyDWebBrowserEvents2<CMozillaBrowser>) CProxyDWebBrowserEvents2<CMozillaBrowser>)
// Other ActiveX/OLE interfaces // Other ActiveX/OLE interfaces
COM_INTERFACE_ENTRY_IMPL(IViewObjectEx) COM_INTERFACE_ENTRY(IViewObjectEx)
COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject2, IViewObjectEx) COM_INTERFACE_ENTRY_IID(IID_IViewObject2, IViewObjectEx)
COM_INTERFACE_ENTRY_IMPL_IID(IID_IViewObject, IViewObjectEx) COM_INTERFACE_ENTRY_IID(IID_IViewObject, IViewObjectEx)
COM_INTERFACE_ENTRY_IMPL(IOleInPlaceObjectWindowless) COM_INTERFACE_ENTRY(IOleInPlaceObjectWindowless)
COM_INTERFACE_ENTRY_IMPL_IID(IID_IOleInPlaceObject, IOleInPlaceObjectWindowless) COM_INTERFACE_ENTRY_IID(IID_IOleInPlaceObject, IOleInPlaceObjectWindowless)
COM_INTERFACE_ENTRY_IMPL(IOleInPlaceActiveObject) COM_INTERFACE_ENTRY(IOleInPlaceActiveObject)
COM_INTERFACE_ENTRY_IMPL(IOleControl) COM_INTERFACE_ENTRY(IOleControl)
COM_INTERFACE_ENTRY_IMPL(IOleObject) COM_INTERFACE_ENTRY(IOleObject)
COM_INTERFACE_ENTRY_IMPL(IQuickActivate) // This causes size assertion in ATL COM_INTERFACE_ENTRY(IQuickActivate) // This causes size assertion in ATL
COM_INTERFACE_ENTRY_IMPL(IPersistStorage) COM_INTERFACE_ENTRY2(IPersist, IPersistPropertyBag)
COM_INTERFACE_ENTRY_IMPL(IPersistStreamInit) COM_INTERFACE_ENTRY(IPersistPropertyBag)
COM_INTERFACE_ENTRY_IMPL(ISpecifyPropertyPages) COM_INTERFACE_ENTRY(IPersistStreamInit)
COM_INTERFACE_ENTRY_IMPL(IDataObject) COM_INTERFACE_ENTRY(IPersistStorage)
COM_INTERFACE_ENTRY(ISpecifyPropertyPages)
COM_INTERFACE_ENTRY(IDataObject)
COM_INTERFACE_ENTRY(IOleCommandTarget) COM_INTERFACE_ENTRY(IOleCommandTarget)
COM_INTERFACE_ENTRY(IProvideClassInfo) COM_INTERFACE_ENTRY(IProvideClassInfo)
COM_INTERFACE_ENTRY(IProvideClassInfo2) COM_INTERFACE_ENTRY(IProvideClassInfo2)
COM_INTERFACE_ENTRY(ISupportErrorInfo) COM_INTERFACE_ENTRY(ISupportErrorInfo)
COM_INTERFACE_ENTRY_IMPL(IConnectionPointContainer) COM_INTERFACE_ENTRY(IConnectionPointContainer)
COM_INTERFACE_ENTRY(IObjectSafety)
END_COM_MAP() END_COM_MAP()
// Properties supported by the control that map onto property // Properties supported by the control that map onto property
@ -145,6 +150,7 @@ BEGIN_PROPERTY_MAP(CMozillaBrowser)
// Example entries // Example entries
// PROP_ENTRY("Property Description", dispid, clsid) // PROP_ENTRY("Property Description", dispid, clsid)
PROP_PAGE(CLSID_StockColorPage) PROP_PAGE(CLSID_StockColorPage)
PROP_DATA_ENTRY("SRC", mInitialSrc, VT_BSTR)
END_PROPERTY_MAP() END_PROPERTY_MAP()
// Table of outgoing connection points. Anyone subscribing // Table of outgoing connection points. Anyone subscribing
@ -386,6 +392,8 @@ protected:
BOOL mHaveDropTargetFlag; BOOL mHaveDropTargetFlag;
// Contains an error message if startup went wrong // Contains an error message if startup went wrong
tstring mStartupErrorMessage; tstring mStartupErrorMessage;
// Initial source url passed in via the container
CComBSTR mInitialSrc;
// List of registered browser helper objects // List of registered browser helper objects
CComUnkPtr *mBrowserHelperList; CComUnkPtr *mBrowserHelperList;
ULONG mBrowserHelperListCount; ULONG mBrowserHelperListCount;
@ -425,7 +433,8 @@ public:
virtual nsresult GetDOMWindow(nsIDOMWindow **aDOMWindow); virtual nsresult GetDOMWindow(nsIDOMWindow **aDOMWindow);
virtual nsresult GetPrefs(nsIPrefBranch **aPrefBranch); virtual nsresult GetPrefs(nsIPrefBranch **aPrefBranch);
virtual PRBool BrowserIsValid(); virtual PRBool BrowserIsValid();
// IWebBrowser
// IWebBrowser
virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch __RPC_FAR *__RPC_FAR *ppDisp); virtual HRESULT STDMETHODCALLTYPE get_Parent(IDispatch __RPC_FAR *__RPC_FAR *ppDisp);
virtual HRESULT STDMETHODCALLTYPE get_Document(IDispatch __RPC_FAR *__RPC_FAR *ppDisp); virtual HRESULT STDMETHODCALLTYPE get_Document(IDispatch __RPC_FAR *__RPC_FAR *ppDisp);
virtual HRESULT STDMETHODCALLTYPE get_RegisterAsDropTarget(VARIANT_BOOL __RPC_FAR *pbRegister); virtual HRESULT STDMETHODCALLTYPE get_RegisterAsDropTarget(VARIANT_BOOL __RPC_FAR *pbRegister);

Просмотреть файл

@ -29,6 +29,38 @@ HKCR
} }
'TypeLib' = s '{1339B53E-3453-11D2-93B9-000000000000}' 'TypeLib' = s '{1339B53E-3453-11D2-93B9-000000000000}'
'Version' = s '1.0' 'Version' = s '1.0'
ForceRemove 'EnableFullPage'
{
ForceRemove .xul
ForceRemove .svg
} }
} }
}
NoRemove MIME
{
NoRemove Database
{
NoRemove 'Content Type'
{
ForceRemove 'application/vnd.mozilla.xul+xml'
{
val Extension = s '.xul'
val CLSID = s '{1339B54C-3453-11D2-93B9-000000000000}'
}
ForceRemove 'image/svg+xml'
{
val Extension = s '.svg'
val CLSID = s '{1339B54C-3453-11D2-93B9-000000000000}'
}
}
}
}
ForceRemove .xul = s 'Mozilla.Browser'
{
ForceRemove val 'Content Type' = s 'application/vnd.mozilla.xul+xml'
}
ForceRemove .svg = s 'Mozilla.Browser'
{
ForceRemove val 'Content Type' = s 'image/svg+xml'
}
} }