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

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

Issue 399143004: Open the WrenchMenu on mouseover when dragging a browser action (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit 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
Index: ui/views/controls/menu/menu_controller.cc
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index 3f59112e743250fca4ffda6a3c1bd89243b30788..4e60f9aceca66fbcf948ad0bbce6458bd393d4f5 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -1578,13 +1578,25 @@ void MenuController::StopShowTimer() {
void MenuController::StartCancelAllTimer() {
cancel_all_timer_.Start(FROM_HERE,
TimeDelta::FromMilliseconds(kCloseOnExitTime),
- this, &MenuController::CancelAll);
+ this, &MenuController::CancelAllForDrag);
}
void MenuController::StopCancelAllTimer() {
cancel_all_timer_.Stop();
}
+void MenuController::CancelAllForDrag() {
+ // It's possible that a child View will be in the middle of a drag-and-drop
+ // operation that we didn't get events for (since we only get updated for
+ // MenuItemViews). If so, just restart the cancel timer.
+ if (state_.item &&
+ state_.item->GetDelegate() &&
+ state_.item->GetDelegate()->InNestedDrag())
sky 2014/07/18 19:36:54 This isn't state that's going to change. So it sho
Devlin 2014/07/18 21:38:31 Sorry, not sure I follow. Passed in to where?
sky 2014/07/18 22:45:39 Into MenuRunner when you Run the menu. Basically I
Devlin 2014/07/21 20:00:56 Done.
+ StartCancelAllTimer();
+ else
+ CancelAll();
+}
+
gfx::Rect MenuController::CalculateMenuBounds(MenuItemView* item,
bool prefer_leading,
bool* is_leading) {

Powered by Google App Engine
This is Rietveld 408576698