Chromium Code Reviews| Index: ui/views/controls/menu/menu_item_view.cc |
| diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc |
| index 15e7db39e64f632c32e0b4c4dd29f646515b5a0f..47d0b4e7521caa8d420f752179cfff20f39a66d2 100644 |
| --- a/ui/views/controls/menu/menu_item_view.cc |
| +++ b/ui/views/controls/menu/menu_item_view.cc |
| @@ -110,6 +110,8 @@ MenuItemView::MenuItemView(MenuDelegate* delegate) |
| use_right_margin_(true) { |
| // NOTE: don't check the delegate for NULL, UpdateMenuPartSizes() supplies a |
| // NULL delegate. |
| + // Note: This class also has a protected constructor and a common Init |
| + // function to initialize both. |
|
Finnur
2014/02/13 10:19:43
I was hoping to see this comment on line 91 (above
|
| Init(NULL, 0, SUBMENU, delegate); |
| } |
| @@ -581,12 +583,16 @@ MenuItemView::MenuItemView(MenuItemView* parent, |
| requested_menu_position_(POSITION_BEST_FIT), |
| actual_menu_position_(requested_menu_position_), |
| use_right_margin_(true) { |
| + // Note: This class also has a public constructor and a common Init function |
| + // to initialize both. |
|
Finnur
2014/02/13 10:19:43
Same here, move to line 564.
|
| Init(parent, command, type, NULL); |
| } |
| MenuItemView::~MenuItemView() { |
| delete submenu_; |
| STLDeleteElements(&removed_items_); |
| + if (lifecycle_observer_) |
| + lifecycle_observer_->OnDeleted(this); |
| } |
| const char* MenuItemView::GetClassName() const { |
| @@ -641,6 +647,7 @@ void MenuItemView::Init(MenuItemView* parent, |
| // Assign our ID, this allows SubmenuItemView to find MenuItemViews. |
| set_id(kMenuItemViewID); |
| has_icons_ = false; |
| + lifecycle_observer_ = NULL; |
| // Don't request enabled status from the root menu item as it is just |
| // a container for real items. EMPTY items will be disabled. |