Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(412)

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm

Issue 2804903003: [Mac] Remove "Open All Bookmarks" menu items from application and wrench menus (Closed)
Patch Set: Rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
index 29a777c9c99b16f6449f5ba36e0bd3f3b87d6d95..6fbfc70482c322d721f895408084c3652dd81963 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
@@ -226,9 +226,6 @@ void BookmarkMenuBridge::ClearBookmarkMenu(NSMenu* menu) {
// an action of openBookmarkMenuItem:. Also, assume all items
// with submenus are submenus of bookmarks.
if (([item action] == @selector(openBookmarkMenuItem:)) ||
- ([item action] == @selector(openAllBookmarks:)) ||
- ([item action] == @selector(openAllBookmarksNewWindow:)) ||
- ([item action] == @selector(openAllBookmarksIncognitoWindow:)) ||
[item hasSubmenu] ||
[item isSeparatorItem]) {
// This will eventually [obj release] all its kids, if it has
@@ -285,57 +282,6 @@ void BookmarkMenuBridge::AddNodeToMenu(const BookmarkNode* node, NSMenu* menu,
ConfigureMenuItem(child, item, false);
}
}
-
- if (add_extra_items) {
- // Add menus for 'Open All Bookmarks'.
- [menu addItem:[NSMenuItem separatorItem]];
- bool enabled = child_count != 0;
-
- IncognitoModePrefs::Availability incognito_availability =
- IncognitoModePrefs::GetAvailability(profile_->GetPrefs());
- bool incognito_enabled =
- enabled && incognito_availability != IncognitoModePrefs::DISABLED;
-
- AddItemToMenu(IDC_BOOKMARK_BAR_OPEN_ALL, IDS_BOOKMARK_BAR_OPEN_ALL_COUNT,
- node, menu, enabled);
- AddItemToMenu(IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW,
- IDS_BOOKMARK_BAR_OPEN_ALL_COUNT_NEW_WINDOW, node, menu,
- enabled);
- AddItemToMenu(IDC_BOOKMARK_BAR_OPEN_ALL_INCOGNITO,
- IDS_BOOKMARK_BAR_OPEN_ALL_COUNT_INCOGNITO, node, menu,
- incognito_enabled);
- }
-}
-
-void BookmarkMenuBridge::AddItemToMenu(int command_id,
- int message_id,
- const BookmarkNode* node,
- NSMenu* menu,
- bool enabled) {
- int count = (message_id == IDS_BOOKMARK_BAR_OPEN_ALL_COUNT_INCOGNITO)
- ? chrome::OpenCount(nullptr, node, profile_)
- : chrome::OpenCount(nullptr, node);
-
- NSString* title = l10n_util::GetPluralNSStringF(message_id, count);
- SEL action;
- if (!enabled) {
- // A nil action makes a menu item appear disabled. NSMenuItem setEnabled
- // will not reflect the disabled state until the item title is set again.
- action = nil;
- } else if (command_id == IDC_BOOKMARK_BAR_OPEN_ALL) {
- action = @selector(openAllBookmarks:);
- } else if (command_id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW) {
- action = @selector(openAllBookmarksNewWindow:);
- } else {
- action = @selector(openAllBookmarksIncognitoWindow:);
- }
- NSMenuItem* item = [[[NSMenuItem alloc] initWithTitle:title
- action:action
- keyEquivalent:@""] autorelease];
- [item setTarget:controller_];
- [item setTag:node->id()];
- [item setEnabled:enabled];
- [menu addItem:item];
}
void BookmarkMenuBridge::ConfigureMenuItem(const BookmarkNode* node,
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698