1 // Copyright 2014 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_DESKTOP_AURA_WINDOW_TREE_HOST_DELEGATE_WAYLAND_H_
6 #define OZONE_IMPL_DESKTOP_AURA_WINDOW_TREE_HOST_DELEGATE_WAYLAND_H_
12 #include "base/basictypes.h"
13 #include "base/message_loop/message_loop.h"
14 #include "ozone/ui/events/window_change_observer.h"
15 #include "ui/events/event.h"
16 #include "ui/events/event_source.h"
17 #include "ui/events/platform/platform_event_dispatcher.h"
18 #include "ui/gfx/native_widget_types.h"
21 class OzoneWaylandWindow;
26 class DesktopWindowTreeHostOzone;
28 // A static class used by DesktopWindowTreeHostOzone to dispatch native events
29 // and basic window management.
30 class WindowTreeHostDelegateWayland
31 : public ui::WindowChangeObserver {
33 WindowTreeHostDelegateWayland();
34 virtual ~WindowTreeHostDelegateWayland();
36 void OnRootWindowCreated(ui::OzoneWaylandWindow* window);
37 void OnRootWindowClosed(ui::OzoneWaylandWindow* window);
39 ui::OzoneWaylandWindow* GetWindow(unsigned handle);
40 bool HasWindowsOpen() const;
43 // Window Change Observer.
44 void OnWindowFocused(unsigned handle) override;
45 void OnWindowEnter(unsigned handle) override;
46 void OnWindowLeave(unsigned handle) override;
47 void OnWindowClose(unsigned handle) override;
48 void OnWindowResized(unsigned windowhandle,
50 unsigned height) override;
51 void OnWindowUnminimized(unsigned windowhandle) override;
52 void OnWindowDeActivated(unsigned windowhandle) override;
53 void OnWindowActivated(unsigned windowhandle) override;
55 // Dispatches a mouse event.
56 std::list<ui::OzoneWaylandWindow*>& open_windows();
58 // List of all open aura::Window.
59 std::list<ui::OzoneWaylandWindow*>* open_windows_;
60 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostDelegateWayland);
65 #endif // OZONE_IMPL_DESKTOP_AURA_WINDOW_TREE_HOST_DELEGATE_WAYLAND_H_