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

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

Issue 2809003002: Making bookmark folder context menu display the number of bookmarks that will be opened by Open All (Closed)
Patch Set: All changes to add count to context menu 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
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 5eff702f1ca1cbf600a25c7b859c168729da08cd..b9cdecdaddbc57af5a69498ac880270a6882148f 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm
@@ -12,6 +12,7 @@
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
+#include "chrome/browser/ui/bookmarks/bookmark_utils_desktop.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_cocoa_controller.h"
@@ -311,7 +312,14 @@ void BookmarkMenuBridge::AddItemToMenu(int command_id,
const BookmarkNode* node,
NSMenu* menu,
bool enabled) {
- NSString* title = l10n_util::GetNSStringWithFixup(message_id);
+ int count = 0;
+ if (message_id == IDS_BOOKMARK_BAR_OPEN_ALL_INCOGNITO) {
+ count = chrome::OpenCount(NULL, node, true, profile_);
Peter Kasting 2017/04/13 04:52:10 Nit: nullptr
Paezagon 2017/04/14 01:00:30 Done.
+ } else {
+ count = chrome::OpenCount(NULL, node);
+ }
Peter Kasting 2017/04/13 04:52:09 Nit: Two potential simpler routes: int count =
Paezagon 2017/04/14 01:00:30 Done.
+
+ NSString* title = l10n_util::GetPluralNSStringF(message_id, count);
SEL action;
if (!enabled) {
// A nil action makes a menu item appear disabled. NSMenuItem setEnabled

Powered by Google App Engine
This is Rietveld 408576698