Bug 607224, followup to use separate interface, r=neil,a=blocking
authorNeil Deakin <neil@mozilla.com>
Mon, 17 Jan 2011 09:36:33 -0500
changeset 60694 b27366868c807e07a11741a7a2eb404ebc08e5e7
parent 60693 70f1fbe19abb1196bba45b335e2a35fbe512e7bb
child 60695 50245d5d1becc808f0cafc6a4b2a9a376c8a8203
push idunknown
push userunknown
push dateunknown
reviewersneil, blocking
bugs607224
milestone2.0b10pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 607224, followup to use separate interface, r=neil,a=blocking
layout/xul/base/public/nsIMenuBoxObject.idl
layout/xul/base/src/nsMenuBoxObject.cpp
toolkit/content/widgets/menu.xml
--- a/layout/xul/base/public/nsIMenuBoxObject.idl
+++ b/layout/xul/base/public/nsIMenuBoxObject.idl
@@ -36,25 +36,31 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #include "nsIBoxObject.idl"
 
 interface nsIDOMElement;
 interface nsIDOMKeyEvent;
 
-[scriptable, uuid(3931F141-D640-48AB-A792-719D62CF1736)]
+[scriptable, uuid(F5099746-5049-4e81-A03E-945D5110FEE2)]
 interface nsIMenuBoxObject : nsISupports
 {
   void openMenu(in boolean openFlag);
 
   attribute nsIDOMElement activeChild;
 
   boolean handleKeyPress(in nsIDOMKeyEvent keyEvent);
+};
 
+// This interface is implemented by menus, but could also
+// be implemented by menubars
+[scriptable, uuid(D03150F6-92A3-4307-A73C-864C8DAD3F22)]
+interface nsIMenuBoxObject_MOZILLA_2_0_BRANCH : nsISupports
+{
   // true if the menu or menubar was opened via a keypress.
   readonly attribute boolean openedWithKey;
 };
 
 %{C++
 nsresult
 NS_NewMenuBoxObject(nsIBoxObject** aResult);
 
--- a/layout/xul/base/src/nsMenuBoxObject.cpp
+++ b/layout/xul/base/src/nsMenuBoxObject.cpp
@@ -41,35 +41,38 @@
 #include "nsIFrame.h"
 #include "nsGUIEvent.h"
 #include "nsIDOMNSUIEvent.h"
 #include "nsMenuBarFrame.h"
 #include "nsMenuBarListener.h"
 #include "nsMenuFrame.h"
 #include "nsMenuPopupFrame.h"
 
-class nsMenuBoxObject : public nsIMenuBoxObject, public nsBoxObject
+class nsMenuBoxObject : public nsIMenuBoxObject,
+                        public nsBoxObject,
+                        public nsIMenuBoxObject_MOZILLA_2_0_BRANCH
 {
 public:
   NS_DECL_ISUPPORTS_INHERITED
   NS_DECL_NSIMENUBOXOBJECT
+  NS_DECL_NSIMENUBOXOBJECT_MOZILLA_2_0_BRANCH
 
   nsMenuBoxObject();
   virtual ~nsMenuBoxObject();
 };
 
 nsMenuBoxObject::nsMenuBoxObject()
 {
 }
 
 nsMenuBoxObject::~nsMenuBoxObject()
 {
 }
 
-NS_IMPL_ISUPPORTS_INHERITED1(nsMenuBoxObject, nsBoxObject, nsIMenuBoxObject)
+NS_IMPL_ISUPPORTS_INHERITED2(nsMenuBoxObject, nsBoxObject, nsIMenuBoxObject, nsIMenuBoxObject_MOZILLA_2_0_BRANCH)
 
 /* void openMenu (in boolean openFlag); */
 NS_IMETHODIMP nsMenuBoxObject::OpenMenu(PRBool aOpenFlag)
 {
   nsXULPopupManager* pm = nsXULPopupManager::GetInstance();
   if (pm) {
     nsIFrame* frame = GetFrame(PR_FALSE);
     if (frame) {
--- a/toolkit/content/widgets/menu.xml
+++ b/toolkit/content/widgets/menu.xml
@@ -57,17 +57,17 @@
           this.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject)
               .openMenu(val);
           return val;
         ]]></setter>
       </property>
 
       <property name="openedWithKey" readonly="true">
         <getter><![CDATA[
-          return this.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject).openedWithKey;
+          return this.boxObject.QueryInterface(Components.interfaces.nsIMenuBoxObject_MOZILLA_2_0_BRANCH).openedWithKey;
         ]]></getter>
       </property>
 
       <!-- nsIDOMXULContainerElement interface -->
       <method name="appendItem">
         <parameter name="aLabel"/>
         <parameter name="aValue"/>
         <body>