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

Unified Diff: ash/wm/toplevel_window_event_filter.cc

Issue 10479018: Add base::RunLoop and update ui_test_utils to use it to reduce flakiness (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: phajdan feedback Created 8 years, 6 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 | « ash/wm/toplevel_window_event_filter.h ('k') | base/base.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/toplevel_window_event_filter.cc
diff --git a/ash/wm/toplevel_window_event_filter.cc b/ash/wm/toplevel_window_event_filter.cc
index b53f786970990c379197330eb5dc080a84e6f3fd..43abc806f7ee3891f642afbf79afea1afcecb38d 100644
--- a/ash/wm/toplevel_window_event_filter.cc
+++ b/ash/wm/toplevel_window_event_filter.cc
@@ -12,6 +12,7 @@
#include "ash/wm/window_util.h"
#include "ash/wm/workspace/snap_sizer.h"
#include "base/message_loop.h"
+#include "base/run_loop.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/env.h"
#include "ui/aura/event.h"
@@ -98,7 +99,7 @@ bool ToplevelWindowEventFilter::PreHandleMouseEvent(aura::Window* target,
DRAG_COMPLETE : DRAG_REVERT,
event->flags());
if (in_move_loop_) {
- MessageLoop::current()->Quit();
+ quit_closure_.Run();
in_move_loop_ = false;
}
// Completing the drag may result in hiding the window. If this happens
@@ -154,7 +155,7 @@ ui::GestureStatus ToplevelWindowEventFilter::PreHandleGestureEvent(
return ui::GESTURE_STATUS_UNKNOWN;
CompleteDrag(DRAG_COMPLETE, event->flags());
if (in_move_loop_) {
- MessageLoop::current()->Quit();
+ quit_closure_.Run();
in_move_loop_ = false;
}
in_gesture_resize_ = false;
@@ -220,7 +221,9 @@ void ToplevelWindowEventFilter::RunMoveLoop(aura::Window* source) {
#if !defined(OS_MACOSX)
MessageLoopForUI* loop = MessageLoopForUI::current();
MessageLoop::ScopedNestableTaskAllower allow_nested(loop);
- loop->RunWithDispatcher(aura::Env::GetInstance()->GetDispatcher());
+ base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher());
+ quit_closure_ = run_loop.QuitClosure();
+ run_loop.Run();
#endif // !defined(OS_MACOSX)
in_gesture_resize_ = in_move_loop_ = false;
}
@@ -234,7 +237,7 @@ void ToplevelWindowEventFilter::EndMoveLoop() {
window_resizer_->RevertDrag();
window_resizer_.reset();
}
- MessageLoopForUI::current()->Quit();
+ quit_closure_.Run();
}
// static
« no previous file with comments | « ash/wm/toplevel_window_event_filter.h ('k') | base/base.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698