1 // Copyright 2013 Intel Corporation. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef OZONE_IMPL_IPC_BROWSER_PROCESS_DISPATCHER_DELEGATE_H_
6 #define OZONE_IMPL_IPC_BROWSER_PROCESS_DISPATCHER_DELEGATE_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "ozone/wayland/dispatcher_delegate.h"
10 #include "ui/events/event.h"
12 namespace ozonewayland {
14 // BrowserProcessDispatcherDelegate is used by dispatcher to post events to
15 // message loop of main thread in the browserProcess. Delegate creates
16 // appropriate event and posts it to message loop of the main thread. The event
17 // is then dispatched to MessagePumpOzone.
19 class BrowserProcessDispatcherDelegate : public WaylandDispatcherDelegate {
21 BrowserProcessDispatcherDelegate();
22 virtual ~BrowserProcessDispatcherDelegate();
24 virtual void MotionNotify(float x, float y) OVERRIDE;
25 virtual void ButtonNotify(unsigned handle,
30 virtual void AxisNotify(float x,
33 float yoffset) OVERRIDE;
34 virtual void PointerEnter(unsigned handle, float x, float y) OVERRIDE;
35 virtual void PointerLeave(unsigned handle, float x, float y) OVERRIDE;
36 virtual void KeyNotify(unsigned type,
38 unsigned modifiers) OVERRIDE;
40 virtual void SetWindowChangeObserver(WindowChangeObserver* observer) OVERRIDE;
43 static void NotifyPointerEnter(BrowserProcessDispatcherDelegate* data,
45 static void NotifyPointerLeave(BrowserProcessDispatcherDelegate* data,
47 static void NotifyButtonPress(BrowserProcessDispatcherDelegate* data,
49 static void DispatchEventHelper(scoped_ptr<ui::Event> key);
50 WindowChangeObserver* observer_;
51 DISALLOW_COPY_AND_ASSIGN(BrowserProcessDispatcherDelegate);
54 } // namespace ozonewayland
56 #endif // OZONE_IMPL_IPC_BROWSER_PROCESS_DISPATCHER_DELEGATE_H_