summaryrefslogtreecommitdiffstats
path: root/ui/wm/public/dispatcher_client.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ui/wm/public/dispatcher_client.cc')
-rw-r--r--ui/wm/public/dispatcher_client.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/ui/wm/public/dispatcher_client.cc b/ui/wm/public/dispatcher_client.cc
index cec4a8a..e3be7ca 100644
--- a/ui/wm/public/dispatcher_client.cc
+++ b/ui/wm/public/dispatcher_client.cc
@@ -4,6 +4,7 @@
#include "ui/wm/public/dispatcher_client.h"
+#include "base/callback.h"
#include "ui/aura/window.h"
#include "ui/aura/window_property.h"
@@ -12,6 +13,28 @@ DECLARE_WINDOW_PROPERTY_TYPE(aura::client::DispatcherClient*);
namespace aura {
namespace client {
+DispatcherRunLoop::DispatcherRunLoop(DispatcherClient* client,
+ base::MessagePumpDispatcher* dispatcher) {
+ client->PrepareNestedLoopClosures(dispatcher, &run_closure_, &quit_closure_);
+}
+
+DispatcherRunLoop::~DispatcherRunLoop() {
+}
+
+void DispatcherRunLoop::Run() {
+ base::MessageLoopForUI* loop = base::MessageLoopForUI::current();
+ base::MessageLoopForUI::ScopedNestableTaskAllower allow_nested(loop);
+ run_closure_.Run();
+}
+
+base::Closure DispatcherRunLoop::QuitClosure() {
+ return quit_closure_;
+}
+
+void DispatcherRunLoop::Quit() {
+ quit_closure_.Run();
+}
+
DEFINE_LOCAL_WINDOW_PROPERTY_KEY(DispatcherClient*, kDispatcherClientKey, NULL);
void SetDispatcherClient(Window* root_window, DispatcherClient* client) {