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

Unified Diff: views/controls/menu/menu_item_view.cc

Issue 328012: Makes it so that when a folder is open on the bookmark bar and the... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « views/controls/menu/menu_item_view.h ('k') | views/controls/menu/submenu_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/menu/menu_item_view.cc
===================================================================
--- views/controls/menu/menu_item_view.cc (revision 29776)
+++ views/controls/menu/menu_item_view.cc (working copy)
@@ -66,23 +66,15 @@
}
MenuItemView::~MenuItemView() {
- if (controller_) {
- // We're currently showing.
-
- // We can't delete ourselves while we're blocking.
- DCHECK(!controller_->IsBlockingRun());
-
- // Invoking Cancel is going to call us back and notify the delegate.
- // Notifying the delegate from the destructor can be problematic. To avoid
- // this the delegate is set to NULL.
- delegate_ = NULL;
-
- controller_->Cancel(true);
- }
+ // TODO(sky): ownership is bit wrong now. In particular if a nested message
+ // loop is running deletion can't be done, otherwise the stack gets
+ // thoroughly screwed. The destructor should be made private, and
+ // MenuController should be the only place handling deletion of the menu.
delete submenu_;
}
void MenuItemView::RunMenuAt(gfx::NativeWindow parent,
+ MenuButton* button,
const gfx::Rect& bounds,
AnchorPosition anchor,
bool has_mnemonics) {
@@ -115,7 +107,7 @@
// Run the loop.
MenuItemView* result =
- controller->Run(parent, this, bounds, anchor, &mouse_event_flags);
+ controller->Run(parent, button, this, bounds, anchor, &mouse_event_flags);
RemoveEmptyMenus();
@@ -151,7 +143,7 @@
// Set the instance, that way it can be canceled by another menu.
MenuController::SetActiveInstance(controller_);
- controller_->Run(parent, this, bounds, anchor, NULL);
+ controller_->Run(parent, NULL, this, bounds, anchor, NULL);
}
void MenuItemView::Cancel() {
@@ -337,9 +329,6 @@
// Currently we only support showing the root.
DCHECK(!parent_menu_item_);
- // Don't invoke run from within run on the same menu.
- DCHECK(!controller_);
-
// Force us to have a submenu.
CreateSubmenu();
« no previous file with comments | « views/controls/menu/menu_item_view.h ('k') | views/controls/menu/submenu_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698