Commit aec829bc authored by Leonard Grey's avatar Leonard Grey Committed by Commit Bot

Cocoa: Retain extension overflow menu item when readding

Bug: 866748
Change-Id: If48fa3bf307e8dc7876360840acced8e83f7572a
Reviewed-on: https://chromium-review.googlesource.com/1148015Reviewed-by: default avatarRobert Sesek <rsesek@chromium.org>
Commit-Queue: Leonard Grey <lgrey@chromium.org>
Cr-Commit-Position: refs/heads/master@{#577522}
parent 30e00dad
......@@ -367,6 +367,9 @@ class ToolbarActionsBarObserverHelper : public ToolbarActionsBarObserver {
return;
// Remove and re-add menu item so menu gets the correct size.
// |removeItemAtIndex:| can trigger an eager dealloc, so retain it
// in the meantime.
base::scoped_nsobject<NSMenuItem> menuItem([browserActionsMenuItem_ retain]);
NSInteger index = [[self menu] indexOfItem:browserActionsMenuItem_];
[[self menu] removeItemAtIndex:index];
[[self menu] insertItem:browserActionsMenuItem_ atIndex:index];
......
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