From 9e599a93b7f032350fb16d4eed59c0ebc3b15db2 Mon Sep 17 00:00:00 2001 From: "sadrul@chromium.org" Date: Sat, 5 Apr 2014 02:34:06 +0000 Subject: ozone: Use PlatformEventSource for dispatching events. Notable changes: * Convert EventFactoryOzone into a PlatformEventSource. * Convert WindowTreeHostOzone into a PlatformEventDispatcher. * The WindowTreeHostOzone looks at the location of the event for mouse, scroll and touch-events to decide whether it should dispatch the event or not. It expects the event-location it receives to be in the same coordinate space as its bounds. * Adds an ObserverList in MessagePumpOzone, and the EventFactoryOzone reaches into the message-pump to trigger these observers. This is a short-term workaround (the same is done for X11 in http://crrev.com/219743002/), until the message-pump observers are converted into PlatformEventObservers. * Have EventConverterEvdev take in a callback that can be used for dispatching events it receives. The EventFactoryEvdev sets this callback to each of these converters after creation. * Change the asynchronous event-dispatch to be synchronous. This set of changes allows dispatching events to multiple window-tree hosts (at least in theory). BUG=319986 R=rjkroege@chromium.org, spang@chromium.org Review URL: https://codereview.chromium.org/223363003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@261953 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/aura/window_tree_host_ozone.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'ui/aura/window_tree_host_ozone.h') diff --git a/ui/aura/window_tree_host_ozone.h b/ui/aura/window_tree_host_ozone.h index dadae63c..0e1f469 100644 --- a/ui/aura/window_tree_host_ozone.h +++ b/ui/aura/window_tree_host_ozone.h @@ -8,9 +8,9 @@ #include #include "base/memory/scoped_ptr.h" -#include "base/message_loop/message_pump_dispatcher.h" #include "ui/aura/window_tree_host.h" #include "ui/events/event_source.h" +#include "ui/events/platform/platform_event_dispatcher.h" #include "ui/gfx/insets.h" #include "ui/gfx/rect.h" @@ -18,16 +18,17 @@ namespace aura { class WindowTreeHostOzone : public WindowTreeHost, public ui::EventSource, - public base::MessagePumpDispatcher { + public ui::PlatformEventDispatcher { public: explicit WindowTreeHostOzone(const gfx::Rect& bounds); virtual ~WindowTreeHostOzone(); private: - // Overridden from Dispatcher overrides: - virtual uint32_t Dispatch(const base::NativeEvent& event) OVERRIDE; + // ui::PlatformEventDispatcher: + virtual bool CanDispatchEvent(const ui::PlatformEvent& event) OVERRIDE; + virtual uint32_t DispatchEvent(const ui::PlatformEvent& event) OVERRIDE; - // WindowTreeHost Overrides. + // WindowTreeHost: virtual gfx::AcceleratedWidget GetAcceleratedWidget() OVERRIDE; virtual void Show() OVERRIDE; virtual void Hide() OVERRIDE; -- cgit v1.1