OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef UI_AURA_WINDOW_TREE_HOST_OZONE_H_ | 5 #ifndef UI_AURA_WINDOW_TREE_HOST_OZONE_H_ |
6 #define UI_AURA_WINDOW_TREE_HOST_OZONE_H_ | 6 #define UI_AURA_WINDOW_TREE_HOST_OZONE_H_ |
7 | 7 |
8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
9 #include "ui/aura/window_tree_host.h" | 9 #include "ui/aura/window_tree_host.h" |
10 #include "ui/events/event_source.h" | 10 #include "ui/events/event_source.h" |
11 #include "ui/gfx/geometry/rect.h" | 11 #include "ui/gfx/geometry/rect.h" |
12 #include "ui/platform_window/platform_window_delegate.h" | 12 #include "ui/platform_window/platform_window_delegate.h" |
13 | 13 |
14 namespace ui { | 14 namespace ui { |
15 class PlatformWindow; | 15 class PlatformWindow; |
16 } | 16 } |
17 | 17 |
18 namespace aura { | 18 namespace aura { |
19 | 19 |
20 class AURA_EXPORT WindowTreeHostOzone : public WindowTreeHost, | 20 class AURA_EXPORT WindowTreeHostOzone : public WindowTreeHost, |
21 public ui::EventSource, | 21 public ui::EventSource, |
22 public ui::PlatformWindowDelegate { | 22 public ui::PlatformWindowDelegate { |
23 public: | 23 public: |
24 explicit WindowTreeHostOzone(const gfx::Rect& bounds); | 24 explicit WindowTreeHostOzone(const gfx::Rect& bounds); |
25 virtual ~WindowTreeHostOzone(); | 25 ~WindowTreeHostOzone() override; |
26 | 26 |
27 protected: | 27 protected: |
28 // WindowTreeHost: | 28 // WindowTreeHost: |
29 virtual gfx::Rect GetBounds() const override; | 29 gfx::Rect GetBounds() const override; |
30 | 30 |
31 private: | 31 private: |
32 // ui::PlatformWindowDelegate: | 32 // ui::PlatformWindowDelegate: |
33 virtual void OnBoundsChanged(const gfx::Rect&) override; | 33 void OnBoundsChanged(const gfx::Rect&) override; |
34 virtual void OnDamageRect(const gfx::Rect& damaged_region) override; | 34 void OnDamageRect(const gfx::Rect& damaged_region) override; |
35 virtual void DispatchEvent(ui::Event* event) override; | 35 void DispatchEvent(ui::Event* event) override; |
36 virtual void OnCloseRequest() override; | 36 void OnCloseRequest() override; |
37 virtual void OnClosed() override; | 37 void OnClosed() override; |
38 virtual void OnWindowStateChanged(ui::PlatformWindowState new_state) override; | 38 void OnWindowStateChanged(ui::PlatformWindowState new_state) override; |
39 virtual void OnLostCapture() override; | 39 void OnLostCapture() override; |
40 virtual void OnAcceleratedWidgetAvailable( | 40 void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) override; |
41 gfx::AcceleratedWidget widget) override; | 41 void OnActivationChanged(bool active) override; |
42 virtual void OnActivationChanged(bool active) override; | |
43 | 42 |
44 // WindowTreeHost: | 43 // WindowTreeHost: |
45 virtual ui::EventSource* GetEventSource() override; | 44 ui::EventSource* GetEventSource() override; |
46 virtual gfx::AcceleratedWidget GetAcceleratedWidget() override; | 45 gfx::AcceleratedWidget GetAcceleratedWidget() override; |
47 virtual void Show() override; | 46 void Show() override; |
48 virtual void Hide() override; | 47 void Hide() override; |
49 virtual void SetBounds(const gfx::Rect& bounds) override; | 48 void SetBounds(const gfx::Rect& bounds) override; |
50 virtual gfx::Point GetLocationOnNativeScreen() const override; | 49 gfx::Point GetLocationOnNativeScreen() const override; |
51 virtual void SetCapture() override; | 50 void SetCapture() override; |
52 virtual void ReleaseCapture() override; | 51 void ReleaseCapture() override; |
53 virtual void SetCursorNative(gfx::NativeCursor cursor_type) override; | 52 void SetCursorNative(gfx::NativeCursor cursor_type) override; |
54 virtual void MoveCursorToNative(const gfx::Point& location) override; | 53 void MoveCursorToNative(const gfx::Point& location) override; |
55 virtual void OnCursorVisibilityChangedNative(bool show) override; | 54 void OnCursorVisibilityChangedNative(bool show) override; |
56 | 55 |
57 // ui::EventSource overrides. | 56 // ui::EventSource overrides. |
58 virtual ui::EventProcessor* GetEventProcessor() override; | 57 ui::EventProcessor* GetEventProcessor() override; |
59 | 58 |
60 // Platform-specific part of this WindowTreeHost. | 59 // Platform-specific part of this WindowTreeHost. |
61 scoped_ptr<ui::PlatformWindow> platform_window_; | 60 scoped_ptr<ui::PlatformWindow> platform_window_; |
62 | 61 |
63 // The identifier used to create a compositing surface. | 62 // The identifier used to create a compositing surface. |
64 gfx::AcceleratedWidget widget_; | 63 gfx::AcceleratedWidget widget_; |
65 | 64 |
66 // Current Aura cursor. | 65 // Current Aura cursor. |
67 gfx::NativeCursor current_cursor_; | 66 gfx::NativeCursor current_cursor_; |
68 | 67 |
69 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostOzone); | 68 DISALLOW_COPY_AND_ASSIGN(WindowTreeHostOzone); |
70 }; | 69 }; |
71 | 70 |
72 } // namespace aura | 71 } // namespace aura |
73 | 72 |
74 #endif // UI_AURA_WINDOW_TREE_HOST_OZONE_H_ | 73 #endif // UI_AURA_WINDOW_TREE_HOST_OZONE_H_ |
OLD | NEW |