Commit 33e3f98a authored by Trent Apted's avatar Trent Apted Committed by Commit Bot

Mac: Elide bookmark subfolders consistently when opened via the mainMenu

bookmark_menu_bridge.mm is used to show bookmarks in the macOS main
menu bar. It currently elides bookmark _titles_ to a custom width before
sending to the Cocoa NSMenuItem. However, bookmark subfolder labels are
not elided until NSMenuItem itself decides to do the elision, which is
done with a much wider width.

Make the widths consistent. This CL adopts the smaller width; used for
bookmark titles. We could also drop our custom elision width and just
let AppKit do it, but that's not the current intention.

Bug: 869270
Change-Id: I2fe86d4e2c8e9d2256fa8b6bdabfa4c75c75faaf
Reviewed-on: https://chromium-review.googlesource.com/1156188Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Trent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#582774}
parent 554b55f3
......@@ -245,7 +245,7 @@ void BookmarkMenuBridge::ClearBookmarkMenu() {
void BookmarkMenuBridge::AddNodeAsSubmenu(NSMenu* menu,
const BookmarkNode* node,
NSImage* image) {
NSString* title = base::SysUTF16ToNSString(node->GetTitle());
NSString* title = [BookmarkMenuCocoaController menuTitleForNode:node];
base::scoped_nsobject<NSMenuItem> items(
[[NSMenuItem alloc] initWithTitle:title action:nil keyEquivalent:@""]);
[items setImage:image];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment