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

Unified Diff: ui/wm/public/dispatcher_client.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/wm/public/dispatcher_client.cc
diff --git a/ui/wm/public/dispatcher_client.cc b/ui/wm/public/dispatcher_client.cc
index cec4a8ad1d6d0d647653d7bc2f6f6f501b61bb1b..e3be7ca848b76ecc597845d43a042dab6b31f03e 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) {
« ui/wm/core/nested_accelerator_controller.cc ('K') | « ui/wm/public/dispatcher_client.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698