summaryrefslogtreecommitdiffstats
path: root/chrome/views/chrome_menu.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/views/chrome_menu.cc')
-rw-r--r--chrome/views/chrome_menu.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/chrome/views/chrome_menu.cc b/chrome/views/chrome_menu.cc
index 271c19b..a0c6abb 100644
--- a/chrome/views/chrome_menu.cc
+++ b/chrome/views/chrome_menu.cc
@@ -1072,6 +1072,9 @@ const int MenuItemView::kMenuItemViewID = 1001;
// static
const int MenuItemView::kDropBetweenPixels = 5;
+// static
+bool MenuItemView::allow_task_nesting_during_run_ = false;
+
MenuItemView::MenuItemView(MenuDelegate* delegate) {
DCHECK(delegate_);
Init(NULL, 0, SUBMENU, delegate);
@@ -1571,7 +1574,15 @@ MenuItemView* MenuController::Run(HWND parent,
DLOG(INFO) << " entering nested loop, depth=" << nested_depth;
#endif
- MessageLoop::current()->Run(this);
+ if (MenuItemView::allow_task_nesting_during_run_) {
+ bool did_allow_task_nesting =
+ MessageLoop::current()->NestableTasksAllowed();
+ MessageLoop::current()->SetNestableTasksAllowed(true);
+ MessageLoop::current()->Run(this);
+ MessageLoop::current()->SetNestableTasksAllowed(did_allow_task_nesting);
+ } else {
+ MessageLoop::current()->Run(this);
+ }
#ifdef DEBUG_MENU
nested_depth--;