Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Unified Diff: ui/views/controls/menu/menu_host.h

Issue 2876203003: Make shelf item can be dragged when context menu is opened.
Patch Set: Add widget observer for |owner_| in MenuHost. Created 3 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/controls/menu/menu_controller_unittest.cc ('k') | ui/views/controls/menu/menu_host.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_;
« no previous file with comments | « ui/views/controls/menu/menu_controller_unittest.cc ('k') | ui/views/controls/menu/menu_host.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698