Fixing bug 238449. Make plugins not get mozilla context menus again. r+sr=dbaron@dbaron.org, a=asa@mozilla.org

This commit is contained in:
jst%mozilla.jstenback.com 2004-04-10 00:25:01 +00:00
Родитель 3fcd745be6
Коммит ea21d2ad3b
3 изменённых файлов: 23 добавлений и 7 удалений

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

@ -125,7 +125,7 @@ static nsresult DispatchToInterface(nsIDOMEvent* aEvent,
if (ifaceListener) {
*aHasInterface = PR_TRUE;
rv = (ifaceListener->*aMethod)(aEvent);
NS_RELEASE(aListener);
NS_RELEASE(ifaceListener);
}
return rv;
}

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

@ -178,7 +178,7 @@ public:
NS_DECL_ISUPPORTS
NS_IMETHOD ContextMenu(nsIDOMEvent* aContextMenuEvent) { return NS_ERROR_FAILURE; /* means consume event */ }
NS_IMETHOD ContextMenu(nsIDOMEvent* aContextMenuEvent);
nsresult Init(nsObjectFrame *aFrame);
nsresult Destroy(nsObjectFrame *aFrame);
@ -1835,8 +1835,8 @@ nsObjectFrame::HandleEvent(nsIPresContext* aPresContext,
nsGUIEvent* anEvent,
nsEventStatus* anEventStatus)
{
NS_ENSURE_ARG_POINTER(anEventStatus);
nsresult rv = NS_OK;
NS_ENSURE_ARG_POINTER(anEventStatus);
nsresult rv = NS_OK;
//FIX FOR CRASHING WHEN NO INSTANCE OWVER
if (!mInstanceOwner)
@ -1994,6 +1994,14 @@ nsPluginDOMContextMenuListener::~nsPluginDOMContextMenuListener()
NS_IMPL_ISUPPORTS2(nsPluginDOMContextMenuListener, nsIDOMContextMenuListener, nsIEventListener)
NS_IMETHODIMP
nsPluginDOMContextMenuListener::ContextMenu(nsIDOMEvent* aContextMenuEvent)
{
aContextMenuEvent->PreventDefault(); /* consume event */
return NS_OK;
}
nsresult nsPluginDOMContextMenuListener::Init(nsObjectFrame *aFrame)
{
nsIContent* content = aFrame->GetContent();

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

@ -178,7 +178,7 @@ public:
NS_DECL_ISUPPORTS
NS_IMETHOD ContextMenu(nsIDOMEvent* aContextMenuEvent) { return NS_ERROR_FAILURE; /* means consume event */ }
NS_IMETHOD ContextMenu(nsIDOMEvent* aContextMenuEvent);
nsresult Init(nsObjectFrame *aFrame);
nsresult Destroy(nsObjectFrame *aFrame);
@ -1835,8 +1835,8 @@ nsObjectFrame::HandleEvent(nsIPresContext* aPresContext,
nsGUIEvent* anEvent,
nsEventStatus* anEventStatus)
{
NS_ENSURE_ARG_POINTER(anEventStatus);
nsresult rv = NS_OK;
NS_ENSURE_ARG_POINTER(anEventStatus);
nsresult rv = NS_OK;
//FIX FOR CRASHING WHEN NO INSTANCE OWVER
if (!mInstanceOwner)
@ -1994,6 +1994,14 @@ nsPluginDOMContextMenuListener::~nsPluginDOMContextMenuListener()
NS_IMPL_ISUPPORTS2(nsPluginDOMContextMenuListener, nsIDOMContextMenuListener, nsIEventListener)
NS_IMETHODIMP
nsPluginDOMContextMenuListener::ContextMenu(nsIDOMEvent* aContextMenuEvent)
{
aContextMenuEvent->PreventDefault(); /* consume event */
return NS_OK;
}
nsresult nsPluginDOMContextMenuListener::Init(nsObjectFrame *aFrame)
{
nsIContent* content = aFrame->GetContent();