Bug 1068384 - Remove legacy code that handled the app menu's update item r=mstange,stefanh

This commit is contained in:
Tim Taubert 2014-09-19 13:40:40 +02:00
parent 54280cb5b3
commit 23b89be3ee
2 changed files with 0 additions and 29 deletions

View File

@ -103,7 +103,6 @@ public:
// The following content nodes have been removed from the menu system. // The following content nodes have been removed from the menu system.
// We save them here for use in command handling. // We save them here for use in command handling.
nsCOMPtr<nsIContent> mAboutItemContent; nsCOMPtr<nsIContent> mAboutItemContent;
nsCOMPtr<nsIContent> mUpdateItemContent;
nsCOMPtr<nsIContent> mPrefItemContent; nsCOMPtr<nsIContent> mPrefItemContent;
nsCOMPtr<nsIContent> mQuitItemContent; nsCOMPtr<nsIContent> mQuitItemContent;

View File

@ -37,7 +37,6 @@ BOOL gSomeMenuBarPainted = NO;
// window does not have a quit or pref item. We don't need strong refs here because // window does not have a quit or pref item. We don't need strong refs here because
// these items are always strong ref'd by their owning menu bar (instance variable). // these items are always strong ref'd by their owning menu bar (instance variable).
static nsIContent* sAboutItemContent = nullptr; static nsIContent* sAboutItemContent = nullptr;
static nsIContent* sUpdateItemContent = nullptr;
static nsIContent* sPrefItemContent = nullptr; static nsIContent* sPrefItemContent = nullptr;
static nsIContent* sQuitItemContent = nullptr; static nsIContent* sQuitItemContent = nullptr;
@ -75,8 +74,6 @@ nsMenuBarX::~nsMenuBarX()
// hidden window, thus we need to invalidate the weak references. // hidden window, thus we need to invalidate the weak references.
if (sAboutItemContent == mAboutItemContent) if (sAboutItemContent == mAboutItemContent)
sAboutItemContent = nullptr; sAboutItemContent = nullptr;
if (sUpdateItemContent == mUpdateItemContent)
sUpdateItemContent = nullptr;
if (sQuitItemContent == mQuitItemContent) if (sQuitItemContent == mQuitItemContent)
sQuitItemContent = nullptr; sQuitItemContent = nullptr;
if (sPrefItemContent == mPrefItemContent) if (sPrefItemContent == mPrefItemContent)
@ -478,13 +475,6 @@ void nsMenuBarX::AquifyMenuBar()
if (!sAboutItemContent) if (!sAboutItemContent)
sAboutItemContent = mAboutItemContent; sAboutItemContent = mAboutItemContent;
// Hide the software update menu item, since it belongs in the application
// menu on Mac OS X.
HideItem(domDoc, NS_LITERAL_STRING("updateSeparator"), nullptr);
HideItem(domDoc, NS_LITERAL_STRING("checkForUpdates"), getter_AddRefs(mUpdateItemContent));
if (!sUpdateItemContent)
sUpdateItemContent = mUpdateItemContent;
// remove quit item and its separator // remove quit item and its separator
HideItem(domDoc, NS_LITERAL_STRING("menu_FileQuitSeparator"), nullptr); HideItem(domDoc, NS_LITERAL_STRING("menu_FileQuitSeparator"), nullptr);
HideItem(domDoc, NS_LITERAL_STRING("menu_FileQuitItem"), getter_AddRefs(mQuitItemContent)); HideItem(domDoc, NS_LITERAL_STRING("menu_FileQuitItem"), getter_AddRefs(mQuitItemContent));
@ -600,7 +590,6 @@ nsresult nsMenuBarX::CreateApplicationMenu(nsMenuX* inMenu)
======================== ========================
= About This App = <- aboutName = About This App = <- aboutName
= Check for Updates... = <- checkForUpdates
======================== ========================
= Preferences... = <- menu_preferences = Preferences... = <- menu_preferences
======================== ========================
@ -644,17 +633,6 @@ nsresult nsMenuBarX::CreateApplicationMenu(nsMenuX* inMenu)
addAboutSeparator = TRUE; addAboutSeparator = TRUE;
} }
// Add the software update menu item
itemBeingAdded = CreateNativeAppMenuItem(inMenu, NS_LITERAL_STRING("checkForUpdates"), @selector(menuItemHit:),
eCommand_ID_Update, nsMenuBarX::sNativeEventTarget);
if (itemBeingAdded) {
[sApplicationMenu addItem:itemBeingAdded];
[itemBeingAdded release];
itemBeingAdded = nil;
addAboutSeparator = TRUE;
}
// Add separator if either the About item or software update item exists // Add separator if either the About item or software update item exists
if (addAboutSeparator) if (addAboutSeparator)
[sApplicationMenu addItem:[NSMenuItem separatorItem]]; [sApplicationMenu addItem:[NSMenuItem separatorItem]];
@ -950,12 +928,6 @@ static BOOL gMenuItemsExecuteCommands = YES;
nsMenuUtilsX::DispatchCommandTo(mostSpecificContent); nsMenuUtilsX::DispatchCommandTo(mostSpecificContent);
return; return;
} }
else if (tag == eCommand_ID_Update) {
nsIContent* mostSpecificContent = sUpdateItemContent;
if (menuBar && menuBar->mUpdateItemContent)
mostSpecificContent = menuBar->mUpdateItemContent;
nsMenuUtilsX::DispatchCommandTo(mostSpecificContent);
}
else if (tag == eCommand_ID_Prefs) { else if (tag == eCommand_ID_Prefs) {
nsIContent* mostSpecificContent = sPrefItemContent; nsIContent* mostSpecificContent = sPrefItemContent;
if (menuBar && menuBar->mPrefItemContent) if (menuBar && menuBar->mPrefItemContent)