- add sources.
[platform/framework/web/crosswalk.git] / src / ozone / impl / ipc / browser_process_dispatcher_delegate.h
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.
4
5 #ifndef OZONE_IMPL_IPC_BROWSER_PROCESS_DISPATCHER_DELEGATE_H_
6 #define OZONE_IMPL_IPC_BROWSER_PROCESS_DISPATCHER_DELEGATE_H_
7
8 #include "base/memory/scoped_ptr.h"
9 #include "ozone/wayland/dispatcher_delegate.h"
10 #include "ui/events/event.h"
11
12 namespace ozonewayland {
13
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.
18
19 class BrowserProcessDispatcherDelegate : public WaylandDispatcherDelegate {
20   public:
21   BrowserProcessDispatcherDelegate();
22   virtual ~BrowserProcessDispatcherDelegate();
23
24   virtual void MotionNotify(float x, float y) OVERRIDE;
25   virtual void ButtonNotify(unsigned handle,
26                             int state,
27                             int flags,
28                             float x,
29                             float y) OVERRIDE;
30   virtual void AxisNotify(float x,
31                           float y,
32                           float xoffset,
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,
37                          unsigned code,
38                          unsigned modifiers) OVERRIDE;
39
40   virtual void SetWindowChangeObserver(WindowChangeObserver* observer) OVERRIDE;
41
42  private:
43   static void NotifyPointerEnter(BrowserProcessDispatcherDelegate* data,
44                                  unsigned handle);
45   static void NotifyPointerLeave(BrowserProcessDispatcherDelegate* data,
46                                  unsigned handle);
47   static void NotifyButtonPress(BrowserProcessDispatcherDelegate* data,
48                                 unsigned handle);
49   static void DispatchEventHelper(scoped_ptr<ui::Event> key);
50   WindowChangeObserver* observer_;
51   DISALLOW_COPY_AND_ASSIGN(BrowserProcessDispatcherDelegate);
52 };
53
54 }  // namespace ozonewayland
55
56 #endif  // OZONE_IMPL_IPC_BROWSER_PROCESS_DISPATCHER_DELEGATE_H_