Chromium Code Reviews| Index: ui/views/controls/menu/menu_item_view.h |
| diff --git a/ui/views/controls/menu/menu_item_view.h b/ui/views/controls/menu/menu_item_view.h |
| index bb1ae266193a1711073eb113c23ce63bf089a8b2..dd6b936907e2a526617652f1f05644361d4178d1 100644 |
| --- a/ui/views/controls/menu/menu_item_view.h |
| +++ b/ui/views/controls/menu/menu_item_view.h |
| @@ -61,6 +61,18 @@ class SubmenuView; |
| class VIEWS_EXPORT MenuItemView : public View { |
| public: |
| + // The LifecycleObserver will receive a notification when the MenuItemView has |
| + // been deleted. |
| + class LifecycleObserver { |
|
sky
2014/02/18 16:03:51
I don't want to add this to MenuItemView. Can you
|
| + public: |
| + virtual ~LifecycleObserver() {} |
| + virtual void OnDeleted(MenuItemView* view) = 0; |
| + }; |
| + |
| + void set_lifecycle_observer(LifecycleObserver* lifecycle_observer) { |
| + lifecycle_observer_ = lifecycle_observer; |
| + } |
| + |
| friend class MenuController; |
| // The menu item view's class name. |
| @@ -526,6 +538,10 @@ class VIEWS_EXPORT MenuItemView : public View { |
| // containing other elements. |
| bool use_right_margin_; |
| + // The observer that we need to notify when the menu item view has been |
| + // deleted. |
| + LifecycleObserver* lifecycle_observer_; |
| + |
| DISALLOW_COPY_AND_ASSIGN(MenuItemView); |
| }; |