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

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

Issue 280483003: wm: Change the DispatcherClient interface. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: self-nit Created 6 years, 7 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
Index: ui/views/controls/menu/menu_controller_unittest.cc
diff --git a/ui/views/controls/menu/menu_controller_unittest.cc b/ui/views/controls/menu/menu_controller_unittest.cc
index 28424c997acf45eb6043002b0eeb7599a13af02e..1c98f95bc9c10cfe26db53c654787ff9c35900a3 100644
--- a/ui/views/controls/menu/menu_controller_unittest.cc
+++ b/ui/views/controls/menu/menu_controller_unittest.cc
@@ -74,22 +74,29 @@ class TestDispatcherClient : public aura::client::DispatcherClient {
}
// aura::client::DispatcherClient:
- virtual void RunWithDispatcher(
- base::MessagePumpDispatcher* dispatcher) OVERRIDE {
+ virtual void PrepareNestedLoopClosures(
+ base::MessagePumpDispatcher* dispatcher,
+ base::Closure* run_closure,
+ base::Closure* quit_closure) OVERRIDE {
+ scoped_ptr<base::RunLoop> run_loop(new base::RunLoop());
+ *quit_closure = run_loop->QuitClosure();
+ *run_closure = base::Bind(&TestDispatcherClient::RunNestedDispatcher,
+ base::Unretained(this),
+ base::Passed(&run_loop),
+ dispatcher);
+ }
+
+ private:
+ void RunNestedDispatcher(scoped_ptr<base::RunLoop> run_loop,
+ base::MessagePumpDispatcher* dispatcher) {
base::AutoReset<base::MessagePumpDispatcher*> reset_dispatcher(&dispatcher_,
dispatcher);
base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
base::MessageLoop::ScopedNestableTaskAllower allow(loop);
- base::RunLoop run_loop;
- quit_callback_ = run_loop.QuitClosure();
- run_loop.Run();
+ run_loop->Run();
}
- virtual void QuitNestedMessageLoop() OVERRIDE { quit_callback_.Run(); }
-
- private:
base::MessagePumpDispatcher* dispatcher_;
- base::Closure quit_callback_;
DISALLOW_COPY_AND_ASSIGN(TestDispatcherClient);
};

Powered by Google App Engine
This is Rietveld 408576698