1 // Copyright 2013 The Chromium Authors. 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 UI_AURA_WINDOW_TREE_HOST_OZONE_H_
6 #define UI_AURA_WINDOW_TREE_HOST_OZONE_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/aura/window_tree_host.h"
10 #include "ui/events/event_source.h"
11 #include "ui/gfx/geometry/rect.h"
12 #include "ui/platform_window/platform_window_delegate.h"
20 class AURA_EXPORT WindowTreeHostOzone
: public WindowTreeHost
,
21 public ui::EventSource
,
22 public ui::PlatformWindowDelegate
{
24 explicit WindowTreeHostOzone(const gfx::Rect
& bounds
);
25 ~WindowTreeHostOzone() override
;
29 ui::EventSource
* GetEventSource() override
;
30 gfx::AcceleratedWidget
GetAcceleratedWidget() override
;
33 gfx::Rect
GetBounds() const override
;
34 void SetBounds(const gfx::Rect
& bounds
) override
;
35 gfx::Point
GetLocationOnNativeScreen() const override
;
36 void SetCapture() override
;
37 void ReleaseCapture() override
;
38 void SetCursorNative(gfx::NativeCursor cursor_type
) override
;
39 void MoveCursorToNative(const gfx::Point
& location
) override
;
40 void OnCursorVisibilityChangedNative(bool show
) override
;
42 ui::PlatformWindow
* platform_window() { return platform_window_
.get(); }
45 // ui::PlatformWindowDelegate:
46 void OnBoundsChanged(const gfx::Rect
&) override
;
47 void OnDamageRect(const gfx::Rect
& damaged_region
) override
;
48 void DispatchEvent(ui::Event
* event
) override
;
49 void OnCloseRequest() override
;
50 void OnClosed() override
;
51 void OnWindowStateChanged(ui::PlatformWindowState new_state
) override
;
52 void OnLostCapture() override
;
53 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget
) override
;
54 void OnActivationChanged(bool active
) override
;
56 // ui::EventSource overrides.
57 ui::EventProcessor
* GetEventProcessor() override
;
59 // Platform-specific part of this WindowTreeHost.
60 scoped_ptr
<ui::PlatformWindow
> platform_window_
;
62 // The identifier used to create a compositing surface.
63 gfx::AcceleratedWidget widget_
;
65 // Current Aura cursor.
66 gfx::NativeCursor current_cursor_
;
68 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostOzone
);
73 #endif // UI_AURA_WINDOW_TREE_HOST_OZONE_H_