Chromium Code Reviews| 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 87199dc9fa6c3adc1872b3d2f9b540ea0fdfdc76..14c002b5eb42a32fecc868e7af71510151aafda9 100644 |
| --- a/ui/views/controls/menu/menu_controller.cc |
| +++ b/ui/views/controls/menu/menu_controller.cc |
| @@ -25,6 +25,7 @@ |
| #include "ui/views/widget/widget.h" |
| #if defined(USE_AURA) |
| +#include "ui/aura/client/dispatcher_client.h" |
| #include "ui/aura/root_window.h" |
| #elif defined(TOOLKIT_USES_GTK) |
| #include "ui/base/keycodes/keyboard_code_conversion_gtk.h" |
| @@ -318,11 +319,17 @@ MenuItemView* MenuController::Run(Widget* parent, |
| // one) the menus are run from a task. If we don't do this and are invoked |
| // from a task none of the tasks we schedule are processed and the menu |
| // appears totally broken. |
| +#if defined(USE_AURA) |
| + aura::client::DispatcherClient* dispatcher_client = |
| + aura::client::GetDispatcherClient(); |
| + dispatcher_client->RunWithDispatcher(this, true); |
|
oshima
2012/01/31 20:42:00
can this be one liner?
|
| +#else |
| MessageLoopForUI* loop = MessageLoopForUI::current(); |
| bool did_allow_task_nesting = loop->NestableTasksAllowed(); |
| loop->SetNestableTasksAllowed(true); |
| loop->RunWithDispatcher(this); |
| loop->SetNestableTasksAllowed(did_allow_task_nesting); |
| +#endif |
| if (ViewsDelegate::views_delegate) |
| ViewsDelegate::views_delegate->ReleaseRef(); |