summaryrefslogtreecommitdiffstats
path: root/chrome/views/chrome_menu.cc
diff options
context:
space:
mode:
authorsky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-11 16:40:57 +0000
committersky@google.com <sky@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-11 16:40:57 +0000
commit4d0cd7ce8c91a2c0157ecf9e0a5153712ff43d10 (patch)
treeeff001f3129de849da6e8658d45072c2ccf494f6 /chrome/views/chrome_menu.cc
parent50f2f629605750f033ef3c766498e42783a785f6 (diff)
downloadchromium_src-4d0cd7ce8c91a2c0157ecf9e0a5153712ff43d10.zip
chromium_src-4d0cd7ce8c91a2c0157ecf9e0a5153712ff43d10.tar.gz
chromium_src-4d0cd7ce8c91a2c0157ecf9e0a5153712ff43d10.tar.bz2
A set of tests to exercise chrome menus as well as parts of bookmark
bar view. These are disabled until we straighten out the buildbot that is always logged in. BUG=1318922 TEST=this is just a bunch of tests. git-svn-id: svn://svn.chromium.org/chrome/trunk/src@654 0039d316-1c4b-4281-b951-d872f2087c98
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--;