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

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

Issue 182753002: Revert of Use the default dispatcher where possible for nested message loops. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 10 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
« no previous file with comments | « ui/aura/client/dispatcher_client.h ('k') | ui/views/widget/desktop_aura/desktop_dispatcher_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 d28862303ae51add52e7bd2600bb2f85a2f6e8d5..00cedd92429945a763674222d393dd4905d077a0 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -13,7 +13,6 @@
#include "base/run_loop.h"
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
-#include "ui/aura/client/dispatcher_client.h"
#include "ui/base/dragdrop/drag_utils.h"
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/l10n/l10n_util.h"
@@ -2304,23 +2303,18 @@
// Exit nested message loops as soon as possible. We do this as
// MessagePumpDispatcher is only invoked before native events, which means
// its entirely possible for a Widget::CloseNow() task to be processed before
- // the next native message. We quite the nested message loop as soon as
- // possible to avoid having deleted views classes (such as widgets and
- // rootviews) on the stack when the nested message loop stops.
+ // the next native message. By using QuitNow() we ensures the nested message
+ // loop returns as soon as possible and avoids having deleted views classes
+ // (such as widgets and rootviews) on the stack when the nested message loop
+ // stops.
//
- // It's safe to invoke QuitNestedMessageLoop() multiple times, it only effects
- // the current loop.
+ // It's safe to invoke QuitNow multiple times, it only effects the current
+ // loop.
bool quit_now = ShouldQuitNow() && exit_type_ != EXIT_NONE &&
message_loop_depth_;
- if (quit_now) {
- if (owner_) {
- aura::Window* root = owner_->GetNativeWindow()->GetRootWindow();
- aura::client::GetDispatcherClient(root)->QuitNestedMessageLoop();
- } else {
- base::MessageLoop::current()->QuitNow();
- }
- }
+ if (quit_now)
+ base::MessageLoop::current()->QuitNow();
}
void MenuController::HandleMouseLocation(SubmenuView* source,
« no previous file with comments | « ui/aura/client/dispatcher_client.h ('k') | ui/views/widget/desktop_aura/desktop_dispatcher_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698