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

Unified Diff: chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm

Issue 1895213002: [Extensions UI Mac] Delete the overflow container when the menu closes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm
diff --git a/chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm b/chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm
index f7c7d5789b180a0bed57d7fe143819b3b5490571..a76602bebf038aff48c846fa81b008fad38dc576 100644
--- a/chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm
+++ b/chrome/browser/ui/cocoa/app_menu/app_menu_controller.mm
@@ -387,17 +387,21 @@ class ToolbarActionsBarObserverHelper : public ToolbarActionsBarObserver {
// menu is about to be displayed at the start of a tracking session.)
zoom_level_observer_.reset();
toolbar_actions_bar_observer_.reset();
+ // Make sure to reset() the BrowserActionsController since the view will also
+ // be destroyed. If a new one's needed, it'll be created when we create the
+ // model in -menuNeedsUpdate:.
+ browserActionsController_.reset();
UMA_HISTOGRAM_TIMES("Toolbar.AppMenuTimeToAction",
base::TimeTicks::Now() - menuOpenTime_);
menuOpenTime_ = base::TimeTicks();
}
- (void)menuNeedsUpdate:(NSMenu*)menu {
+ // We should never have a BrowserActionsController before creating the menu.
+ DCHECK(!browserActionsController_.get());
+
// First empty out the menu and create a new model.
[self removeAllItems:menu];
- // Delete the BrowserActionsController; if a new one's needed, it'll be
- // created as we add items to the menu.
- browserActionsController_.reset();
[self createModel];
[menu setMinimumWidth:0];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698