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

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

Issue 378333003: Allow menus to stay open during a child view's drag and drop (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Test Fix Created 6 years, 5 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 | « chrome/chrome_tests.gypi ('k') | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_controller.h
diff --git a/ui/views/controls/menu/menu_controller.h b/ui/views/controls/menu/menu_controller.h
index 30c56f0f04b88d9f36b68454c3851f526f5a1533..1a4c195a74b200bdc90e1c8e97c9603d86154eac 100644
--- a/ui/views/controls/menu/menu_controller.h
+++ b/ui/views/controls/menu/menu_controller.h
@@ -92,6 +92,10 @@ class VIEWS_EXPORT MenuController : public WidgetObserver {
// Whether or not drag operation is in progress.
bool drag_in_progress() const { return drag_in_progress_; }
+ // Whether the MenuController initiated the drag in progress. False if there
+ // is no drag in progress.
+ bool did_initiate_drag() const { return did_initiate_drag_; }
+
// Returns the owner of child windows.
// WARNING: this may be NULL.
Widget* owner() { return owner_; }
@@ -142,6 +146,15 @@ class VIEWS_EXPORT MenuController : public WidgetObserver {
void OnDragEnteredScrollButton(SubmenuView* source, bool is_up);
void OnDragExitedScrollButton(SubmenuView* source);
+ // Called by the Widget when a drag is about to start on a child view. This
+ // could be initiated by one of our MenuItemViews, or could be through another
+ // child View.
+ void OnDragWillStart();
+
+ // Called by the Widget when the drag has completed. |should_close|
+ // corresponds to whether or not the menu should close.
+ void OnDragComplete(bool should_close);
+
// Update the submenu's selection based on the current mouse location
void UpdateSubmenuSelection(SubmenuView* source);
@@ -556,6 +569,11 @@ class VIEWS_EXPORT MenuController : public WidgetObserver {
// True when drag operation is in progress.
bool drag_in_progress_;
+ // True when the drag operation in progress was initiated by the
+ // MenuController for a child MenuItemView (as opposed to initiated separately
+ // by a child View).
+ bool did_initiate_drag_;
+
// Location the mouse was pressed at. Used to detect d&d.
gfx::Point press_pt_;
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | ui/views/controls/menu/menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698