Bug 1037433 - Trigger icon loads for the root menu item of a standalone native menu. r=smichaud
authorMarkus Stange <mstange@themasta.com>
Fri, 18 Jul 2014 21:06:54 +0200
changeset 215768 81a1e00bc476004078a35fa6d7c504433c309989
parent 215767 bfa9065c5da1eb93c0f8ec10e5197af4cefe68e8
child 215769 970d8f4b1d1449f3d47e53e4d5847efd5e5fae43
push id3857
push userraliiev@mozilla.com
push dateTue, 02 Sep 2014 16:39:23 +0000
treeherdermozilla-beta@5638b907b505 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmichaud
bugs1037433
milestone33.0a1
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 1037433 - Trigger icon loads for the root menu item of a standalone native menu. r=smichaud
widget/cocoa/nsMenuX.h
widget/cocoa/nsStandaloneNativeMenu.mm
--- a/widget/cocoa/nsMenuX.h
+++ b/widget/cocoa/nsMenuX.h
@@ -58,25 +58,25 @@ public:
   uint32_t       GetItemCount();
   nsMenuObjectX* GetItemAt(uint32_t aPos);
   nsresult       GetVisibleItemCount(uint32_t &aCount);
   nsMenuObjectX* GetVisibleItemAt(uint32_t aPos);
   nsEventStatus  MenuOpened();
   void           MenuClosed();
   void           SetRebuild(bool aMenuEvent);
   NSMenuItem*    NativeMenuItem();
+  nsresult       SetupIcon();
 
   static bool    IsXULHelpMenu(nsIContent* aMenuContent);
 
 protected:
   void           MenuConstruct();
   nsresult       RemoveAll();
   nsresult       SetEnabled(bool aIsEnabled);
   nsresult       GetEnabled(bool* aIsEnabled);
-  nsresult       SetupIcon();
   void           GetMenuPopupContent(nsIContent** aResult);
   bool           OnOpen();
   bool           OnClose();
   nsresult       AddMenuItem(nsMenuItemX* aMenuItem);
   nsresult       AddMenu(nsMenuX* aMenu);
   void           LoadMenuItem(nsIContent* inMenuItemContent);  
   void           LoadSubMenu(nsIContent* inMenuContent);
   GeckoNSMenu*   CreateMenuWithGeckoString(nsString& menuTitle);
--- a/widget/cocoa/nsStandaloneNativeMenu.mm
+++ b/widget/cocoa/nsStandaloneNativeMenu.mm
@@ -48,16 +48,18 @@ nsStandaloneNativeMenu::Init(nsIDOMEleme
   mMenu = new nsMenuX();
   rv = mMenu->Create(this, this, content);
   if (NS_FAILED(rv)) {
     delete mMenu;
     mMenu = nullptr;
     return rv;
   }
 
+  mMenu->SetupIcon();
+
   return NS_OK;
 }
 
 static void
 UpdateMenu(nsMenuX * aMenu)
 {
   aMenu->MenuOpened();
   aMenu->MenuClosed();