| Index: ui/views/controls/menu/menu_host.h
|
| diff --git a/ui/views/controls/menu/menu_host.h b/ui/views/controls/menu/menu_host.h
|
| index 484b90889320a3c7c05724aacfbab234382db741..b49f58930e566355b0c3f954b5b0d94c11e00506 100644
|
| --- a/ui/views/controls/menu/menu_host.h
|
| +++ b/ui/views/controls/menu/menu_host.h
|
| @@ -11,6 +11,7 @@
|
| #include "base/macros.h"
|
| #include "ui/gfx/geometry/rect.h"
|
| #include "ui/views/widget/widget.h"
|
| +#include "ui/views/widget/widget_observer.h"
|
|
|
| namespace views {
|
|
|
| @@ -36,7 +37,7 @@ class MenuControllerTest;
|
| // OS destroys the widget out from under us, in which case |MenuHostDestroyed|
|
| // is invoked back on the SubmenuView and the SubmenuView then drops references
|
| // to the MenuHost.
|
| -class MenuHost : public Widget {
|
| +class MenuHost : public Widget, public WidgetObserver {
|
| public:
|
| explicit MenuHost(SubmenuView* submenu);
|
| ~MenuHost() override;
|
| @@ -70,7 +71,7 @@ class MenuHost : public Widget {
|
| private:
|
| friend class test::MenuControllerTest;
|
|
|
| - // Overridden from Widget:
|
| + // Widget:
|
| internal::RootView* CreateRootView() override;
|
| void OnMouseCaptureLost() override;
|
| void OnNativeWidgetDestroyed() override;
|
| @@ -78,6 +79,12 @@ class MenuHost : public Widget {
|
| void OnDragWillStart() override;
|
| void OnDragComplete() override;
|
|
|
| + // WidgetObserver:
|
| + void OnWidgetDestroying(Widget* widget) override;
|
| +
|
| + // Parent of the MenuHost widget.
|
| + Widget* owner_ = nullptr;
|
| +
|
| // The view we contain.
|
| SubmenuView* submenu_;
|
|
|
|
|