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..c4d9d74d606983530a53725a22d0a4778dd48189 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,18 @@ 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(); |
| + DCHECK(dispatcher_client); |
|
oshima
2012/01/31 18:19:52
no need for DCHECK as next line fill fail immediat
pkotwicz
2012/01/31 20:01:07
Done.
|
| + dispatcher_client->RunWithDispatcher(this, true); |
| +#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(); |