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

Unified Diff: ash/drag_drop/drag_drop_controller.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/drag_drop/drag_drop_controller.h ('k') | ash/test/ash_test_base.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/drag_drop/drag_drop_controller.cc
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc
index 8cf03faf648c40e82033f0f43b09df71af8781ee..de68a1c3cda8cc440bd5b1096f10a52c5adc286a 100644
--- a/ash/drag_drop/drag_drop_controller.cc
+++ b/ash/drag_drop/drag_drop_controller.cc
@@ -7,6 +7,7 @@
#include "ash/drag_drop/drag_image_view.h"
#include "ash/shell.h"
#include "base/message_loop.h"
+#include "base/run_loop.h"
#include "ui/aura/client/capture_client.h"
#include "ui/aura/client/drag_drop_delegate.h"
#include "ui/aura/cursor_manager.h"
@@ -82,9 +83,11 @@ int DragDropController::StartDragAndDrop(const ui::OSExchangeData& data,
#if !defined(OS_MACOSX)
if (should_block_during_drag_drop_) {
+ base::RunLoop run_loop(aura::Env::GetInstance()->GetDispatcher());
+ quit_closure_ = run_loop.QuitClosure();
MessageLoopForUI* loop = MessageLoopForUI::current();
MessageLoop::ScopedNestableTaskAllower allow_nested(loop);
- loop->RunWithDispatcher(aura::Env::GetInstance()->GetDispatcher());
+ run_loop.Run();
}
#endif // !defined(OS_MACOSX)
@@ -163,7 +166,7 @@ void DragDropController::Drop(aura::Window* target,
Cleanup();
if (should_block_during_drag_drop_)
- MessageLoop::current()->QuitNow();
+ quit_closure_.Run();
}
void DragDropController::DragCancel() {
@@ -181,7 +184,7 @@ void DragDropController::DragCancel() {
drag_operation_ = 0;
StartCanceledAnimation();
if (should_block_during_drag_drop_)
- MessageLoop::current()->QuitNow();
+ quit_closure_.Run();
}
bool DragDropController::IsDragDropInProgress() {
« no previous file with comments | « ash/drag_drop/drag_drop_controller.h ('k') | ash/test/ash_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698