diff options
Diffstat (limited to 'views/controls/menu/menu_controller.cc')
-rw-r--r-- | views/controls/menu/menu_controller.cc | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/views/controls/menu/menu_controller.cc b/views/controls/menu/menu_controller.cc index 429d537..c57ba09 100644 --- a/views/controls/menu/menu_controller.cc +++ b/views/controls/menu/menu_controller.cc @@ -366,6 +366,12 @@ MenuItemView* MenuController::Run(Widget* parent, } void MenuController::Cancel(ExitType type) { + // If the menu has already been destroyed, no further cancellation is + // needed. We especially don't want to set the |exit_type_| to a lesser + // value. + if (exit_type_ == EXIT_DESTROYED) + return; + if (!showing_) { // This occurs if we're in the process of notifying the delegate for a drop // and the delegate cancels us. @@ -738,6 +744,11 @@ void MenuController::OnDragExitedScrollButton(SubmenuView* source) { StopScrolling(); } +void MenuController::OnWidgetActivationChanged() { + if (!drag_in_progress_) + Cancel(EXIT_ALL); +} + void MenuController::SetSelection(MenuItemView* menu_item, int selection_types) { size_t paths_differ_at = 0; |