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 #include "ui/aura/window_tree_host_ozone.h" | 5 #include "ui/aura/window_tree_host_ozone.h" |
6 | 6 |
7 #include "ui/aura/window_event_dispatcher.h" | 7 #include "ui/aura/window_event_dispatcher.h" |
8 #include "ui/ozone/public/ozone_platform.h" | 8 #include "ui/ozone/public/ozone_platform.h" |
9 #include "ui/platform_window/platform_window.h" | 9 #include "ui/platform_window/platform_window.h" |
10 | 10 |
11 namespace aura { | 11 namespace aura { |
12 | 12 |
13 WindowTreeHostOzone::WindowTreeHostOzone(const gfx::Rect& bounds) | 13 WindowTreeHostOzone::WindowTreeHostOzone(const gfx::Rect& bounds) |
14 : widget_(gfx::kNullAcceleratedWidget), current_cursor_(ui::kCursorNull) { | 14 : widget_(gfx::kNullAcceleratedWidget), current_cursor_(ui::kCursorNull) { |
15 platform_window_ = | 15 platform_window_ = |
16 ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds); | 16 ui::OzonePlatform::GetInstance()->CreatePlatformWindow(this, bounds); |
17 } | 17 } |
18 | 18 |
19 WindowTreeHostOzone::~WindowTreeHostOzone() { | 19 WindowTreeHostOzone::~WindowTreeHostOzone() { |
20 DestroyCompositor(); | 20 DestroyCompositor(); |
21 DestroyDispatcher(); | 21 DestroyDispatcher(); |
22 } | 22 } |
23 | 23 |
| 24 gfx::Rect WindowTreeHostOzone::GetBounds() const { |
| 25 return platform_window_->GetBounds(); |
| 26 } |
| 27 |
24 void WindowTreeHostOzone::OnBoundsChanged(const gfx::Rect& new_bounds) { | 28 void WindowTreeHostOzone::OnBoundsChanged(const gfx::Rect& new_bounds) { |
25 // TOOD(spang): Should we determine which parts changed? | 29 // TOOD(spang): Should we determine which parts changed? |
26 OnHostResized(new_bounds.size()); | 30 OnHostResized(new_bounds.size()); |
27 OnHostMoved(new_bounds.origin()); | 31 OnHostMoved(new_bounds.origin()); |
28 } | 32 } |
29 | 33 |
30 void WindowTreeHostOzone::OnDamageRect(const gfx::Rect& damaged_region) { | 34 void WindowTreeHostOzone::OnDamageRect(const gfx::Rect& damaged_region) { |
31 } | 35 } |
32 | 36 |
33 void WindowTreeHostOzone::DispatchEvent(ui::Event* event) { | 37 void WindowTreeHostOzone::DispatchEvent(ui::Event* event) { |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 } | 70 } |
67 | 71 |
68 void WindowTreeHostOzone::Show() { | 72 void WindowTreeHostOzone::Show() { |
69 platform_window_->Show(); | 73 platform_window_->Show(); |
70 } | 74 } |
71 | 75 |
72 void WindowTreeHostOzone::Hide() { | 76 void WindowTreeHostOzone::Hide() { |
73 platform_window_->Hide(); | 77 platform_window_->Hide(); |
74 } | 78 } |
75 | 79 |
76 gfx::Rect WindowTreeHostOzone::GetBounds() const { | |
77 return platform_window_->GetBounds(); | |
78 } | |
79 | |
80 void WindowTreeHostOzone::SetBounds(const gfx::Rect& bounds) { | 80 void WindowTreeHostOzone::SetBounds(const gfx::Rect& bounds) { |
81 platform_window_->SetBounds(bounds); | 81 platform_window_->SetBounds(bounds); |
82 } | 82 } |
83 | 83 |
84 gfx::Point WindowTreeHostOzone::GetLocationOnNativeScreen() const { | 84 gfx::Point WindowTreeHostOzone::GetLocationOnNativeScreen() const { |
85 return platform_window_->GetBounds().origin(); | 85 return platform_window_->GetBounds().origin(); |
86 } | 86 } |
87 | 87 |
88 void WindowTreeHostOzone::SetCapture() { | 88 void WindowTreeHostOzone::SetCapture() { |
89 platform_window_->SetCapture(); | 89 platform_window_->SetCapture(); |
(...skipping 27 matching lines...) Expand all Loading... |
117 return new WindowTreeHostOzone(bounds); | 117 return new WindowTreeHostOzone(bounds); |
118 } | 118 } |
119 | 119 |
120 // static | 120 // static |
121 gfx::Size WindowTreeHost::GetNativeScreenSize() { | 121 gfx::Size WindowTreeHost::GetNativeScreenSize() { |
122 NOTIMPLEMENTED(); | 122 NOTIMPLEMENTED(); |
123 return gfx::Size(); | 123 return gfx::Size(); |
124 } | 124 } |
125 | 125 |
126 } // namespace aura | 126 } // namespace aura |
OLD | NEW |