Bug 665586 Part 2: Kill AddEventListenerByIID/RemoveEventListenerByIID code from nsPluginDOMContextMenuListener. r=josh
authorJonas Sicking <jonas@sicking.cc>
Mon, 08 Aug 2011 11:26:26 -0700
changeset 74028 196eadbe49de031f1eb67c1321fb7a57159ed79c
parent 74027 ec15be691f62ae193e46bd31c8a187493baa8eb5
child 74029 c1c58c2bf9dfb09c74386e79ae50812bc57e5a2d
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
reviewersjosh
bugs665586
milestone8.0a1
Bug 665586 Part 2: Kill AddEventListenerByIID/RemoveEventListenerByIID code from nsPluginDOMContextMenuListener. r=josh
dom/plugins/base/nsPluginInstanceOwner.cpp
--- a/dom/plugins/base/nsPluginInstanceOwner.cpp
+++ b/dom/plugins/base/nsPluginInstanceOwner.cpp
@@ -65,17 +65,16 @@ enum { XKeyPress = KeyPress };
 using mozilla::DefaultXDisplay;
 #endif
 
 #include "nsPluginInstanceOwner.h"
 #include "nsIRunnable.h"
 #include "nsContentUtils.h"
 #include "nsRect.h"
 #include "nsSize.h"
-#include "nsIDOMContextMenuListener.h"
 #include "nsDisplayList.h"
 #include "ImageLayers.h"
 #include "nsIDOMEventTarget.h"
 #include "nsObjectFrame.h"
 #include "nsIPluginDocument.h"
 #include "nsIStringStream.h"
 #include "nsNetUtil.h"
 #include "mozilla/Preferences.h"
@@ -119,33 +118,28 @@ static NS_DEFINE_CID(kAppShellCID, NS_AP
 #include "gfxXlibNativeRenderer.h"
 #endif
 
 using namespace mozilla;
 
 // special class for handeling DOM context menu events because for
 // some reason it starves other mouse events if implemented on the
 // same class
-class nsPluginDOMContextMenuListener : public nsIDOMContextMenuListener
+class nsPluginDOMContextMenuListener : public nsIDOMEventListener
 {
 public:
   nsPluginDOMContextMenuListener();
   virtual ~nsPluginDOMContextMenuListener();
 
   NS_DECL_ISUPPORTS
-
-  NS_IMETHOD ContextMenu(nsIDOMEvent* aContextMenuEvent);
-  
+  NS_DECL_NSIDOMEVENTLISTENER
+
   nsresult Init(nsIContent* aContent);
   nsresult Destroy(nsIContent* aContent);
   
-  NS_IMETHOD HandleEvent(nsIDOMEvent* aEvent)
-  {
-    return NS_OK;
-  }
   nsEventStatus ProcessEvent(const nsGUIEvent& anEvent)
   {
     return nsEventStatus_eConsumeNoDefault;
   }
 };
 
 class AsyncPaintWaitEvent : public nsRunnable
 {
@@ -3310,24 +3304,23 @@ void nsPluginInstanceOwner::FixUpURLS(co
 nsPluginDOMContextMenuListener::nsPluginDOMContextMenuListener()
 {
 }
 
 nsPluginDOMContextMenuListener::~nsPluginDOMContextMenuListener()
 {
 }
 
-NS_IMPL_ISUPPORTS2(nsPluginDOMContextMenuListener,
-                   nsIDOMContextMenuListener,
+NS_IMPL_ISUPPORTS1(nsPluginDOMContextMenuListener,
                    nsIDOMEventListener)
 
 NS_IMETHODIMP
-nsPluginDOMContextMenuListener::ContextMenu(nsIDOMEvent* aContextMenuEvent)
+nsPluginDOMContextMenuListener::HandleEvent(nsIDOMEvent* aEvent)
 {
-  aContextMenuEvent->PreventDefault(); // consume event
+  aEvent->PreventDefault(); // consume event
   
   return NS_OK;
 }
 
 nsresult nsPluginDOMContextMenuListener::Init(nsIContent* aContent)
 {
   nsCOMPtr<nsIDOMEventTarget> receiver(do_QueryInterface(aContent));
   if (receiver) {