Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/views/controls/menu/menu_host.h" | 5 #include "ui/views/controls/menu/menu_host.h" |
| 6 | 6 |
| 7 #include "ui/views/controls/menu/menu_controller.h" | 7 #include "ui/views/controls/menu/menu_controller.h" |
| 8 #include "ui/views/controls/menu/menu_host_root_view.h" | 8 #include "ui/views/controls/menu/menu_host_root_view.h" |
| 9 #include "ui/views/controls/menu/menu_item_view.h" | 9 #include "ui/views/controls/menu/menu_item_view.h" |
| 10 #include "ui/views/controls/menu/native_menu_host.h" | 10 #include "ui/views/controls/menu/native_menu_host.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 101 void MenuHost::OnNativeWidgetDestroyed() { | 101 void MenuHost::OnNativeWidgetDestroyed() { |
| 102 if (!destroying_) { | 102 if (!destroying_) { |
| 103 // We weren't explicitly told to destroy ourselves, which means the menu was | 103 // We weren't explicitly told to destroy ourselves, which means the menu was |
| 104 // deleted out from under us (the window we're parented to was closed). Tell | 104 // deleted out from under us (the window we're parented to was closed). Tell |
| 105 // the SubmenuView to drop references to us. | 105 // the SubmenuView to drop references to us. |
| 106 submenu_->MenuHostDestroyed(); | 106 submenu_->MenuHostDestroyed(); |
| 107 } | 107 } |
| 108 Widget::OnNativeWidgetDestroyed(); | 108 Widget::OnNativeWidgetDestroyed(); |
| 109 } | 109 } |
| 110 | 110 |
| 111 void MenuHost::OnOwnerClosing() { | |
|
oshima
2012/04/26 15:03:07
can you add comment that this is invoked only on w
| |
| 112 MenuController* menu_controller = | |
|
oshima
2012/04/26 15:03:07
can you add comment that this is used only on Wind
| |
| 113 submenu_->GetMenuItem()->GetMenuController(); | |
| 114 if (menu_controller && !menu_controller->drag_in_progress()) | |
| 115 menu_controller->CancelAll(); | |
| 116 } | |
| 117 | |
| 111 } // namespace views | 118 } // namespace views |
| OLD | NEW |