summaryrefslogtreecommitdiffstats
path: root/ui/aura/env.h
diff options
context:
space:
mode:
Diffstat (limited to 'ui/aura/env.h')
-rw-r--r--ui/aura/env.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/ui/aura/env.h b/ui/aura/env.h
index 12cb2ef..a4fee63 100644
--- a/ui/aura/env.h
+++ b/ui/aura/env.h
@@ -6,6 +6,8 @@
#define UI_AURA_ENV_H_
#pragma once
+#include "base/memory/scoped_ptr.h"
+#include "base/message_loop.h"
#include "base/observer_list.h"
#include "ui/aura/aura_export.h"
@@ -14,6 +16,9 @@ namespace aura {
class EnvObserver;
class Window;
+// Creates a platform-specific native event dispatcher.
+MessageLoop::Dispatcher* CreateDispatcher();
+
// A singleton object that tracks general state within Aura.
// TODO(beng): manage RootWindows.
class AURA_EXPORT Env {
@@ -27,6 +32,14 @@ class AURA_EXPORT Env {
void AddObserver(EnvObserver* observer);
void RemoveObserver(EnvObserver* observer);
+ // Returns the native event dispatcher. The result should only be passed to
+ // MessageLoopForUI::RunWithDispatcher() or
+ // MessageLoopForUI::RunAllPendingWithDispatcher(), or used to dispatch
+ // an event by |Dispatch(const NativeEvent&)| on it. It must never be stored.
+#if !defined(OS_MACOSX)
+ MessageLoop::Dispatcher* GetDispatcher();
+#endif
+
private:
friend class Window;
@@ -34,6 +47,10 @@ class AURA_EXPORT Env {
void NotifyWindowInitialized(Window* window);
ObserverList<EnvObserver> observers_;
+#if defined(OS_WIN)
+ // TODO(beng): remove the ifdef once the linux dispatcher is complete.
+ scoped_ptr<MessageLoop::Dispatcher> dispatcher_;
+#endif
static Env* instance_;