Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Side by Side Diff: ui/views/widget/desktop_aura/desktop_root_window_host_ozone.cc

Issue 36953002: views: Support Desktop Aura creation on Ozone (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: implementing with DesktopRootWindowHostOzone class instead Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/views/widget/desktop_aura/desktop_root_window_host_ozone.h"
6
7 #include "ui/aura/client/drag_drop_client.h"
5 #include "ui/aura/window_tree_host.h" 8 #include "ui/aura/window_tree_host.h"
9 #include "ui/views/corewm/tooltip_aura.h"
6 #include "ui/views/widget/desktop_aura/desktop_root_window_host.h" 10 #include "ui/views/widget/desktop_aura/desktop_root_window_host.h"
7 #include "ui/views/widget/desktop_aura/desktop_factory_ozone.h" 11 #include "ui/views/widget/desktop_aura/desktop_factory_ozone.h"
8 12
9 namespace views { 13 namespace views {
10 14
15 DesktopRootWindowHostOzone* drwh_ozone_;
16
17 ////////////////////////////////////////////////////////////////////////////////
18 // DesktopRootWindowHostOzone, public:
19 DesktopRootWindowHostOzone::DesktopRootWindowHostOzone(
20 internal::NativeWidgetDelegate* native_widget_delegate,
21 DesktopNativeWidgetAura* desktop_native_widget_aura) {
22 DesktopRootWindowHost::Create(native_widget_delegate,
23 desktop_native_widget_aura);
24 }
25
26 DesktopRootWindowHostOzone::~DesktopRootWindowHostOzone() {
27 }
28
29 ////////////////////////////////////////////////////////////////////////////////
30 // DesktopRootWindowHostOzone, DesktopRootWindowHost implementation:
31
32 void DesktopRootWindowHostOzone::Init(
33 aura::Window* content_window,
34 const Widget::InitParams& params,
35 aura::RootWindow::CreateParams* rw_create_params) {
36 drwh_ozone_->Init(content_window, params, rw_create_params);
37 }
38
39 void DesktopRootWindowHostOzone::OnRootWindowCreated(
40 aura::RootWindow* root,
41 const Widget::InitParams& params) {
42 drwh_ozone_->OnRootWindowCreated(root, params);
43 }
44
45 scoped_ptr<corewm::Tooltip> DesktopRootWindowHostOzone::CreateTooltip() {
46 return drwh_ozone_->CreateTooltip();
47 }
48
49 scoped_ptr<aura::client::DragDropClient>
50 DesktopRootWindowHostOzone::CreateDragDropClient(
51 DesktopNativeCursorManager* cursor_manager) {
52 return drwh_ozone_->CreateDragDropClient(cursor_manager);
53 }
54
55 void DesktopRootWindowHostOzone::Close() {
56 drwh_ozone_->Close();
57 }
58
59 void DesktopRootWindowHostOzone::CloseNow() {
60 drwh_ozone_->CloseNow();
61 }
62
63 aura::RootWindowHost* DesktopRootWindowHostOzone::AsRootWindowHost() {
64 return drwh_ozone_->AsRootWindowHost();
65 }
66
67 void DesktopRootWindowHostOzone::ShowWindowWithState(
68 ui::WindowShowState show_state) {
69 drwh_ozone_->ShowWindowWithState(show_state);
70 }
71
72 void DesktopRootWindowHostOzone::ShowMaximizedWithBounds(
73 const gfx::Rect& restored_bounds) {
74 drwh_ozone_->ShowMaximizedWithBounds(restored_bounds);
75 }
76
77 bool DesktopRootWindowHostOzone::IsVisible() const {
78 return drwh_ozone_->IsVisible();
79 }
80
81 void DesktopRootWindowHostOzone::SetSize(const gfx::Size& size) {
82 drwh_ozone_->SetSize(size);
83 }
84
85 void DesktopRootWindowHostOzone::CenterWindow(const gfx::Size& size) {
86 drwh_ozone_->CenterWindow(size);
87 }
88
89 void DesktopRootWindowHostOzone::GetWindowPlacement(
90 gfx::Rect* bounds,
91 ui::WindowShowState* show_state) const {
92 drwh_ozone_->GetWindowPlacement(bounds, show_state);
93 }
94
95 gfx::Rect DesktopRootWindowHostOzone::GetWindowBoundsInScreen() const {
96 return drwh_ozone_->GetWindowBoundsInScreen();
97 }
98
99 gfx::Rect DesktopRootWindowHostOzone::GetClientAreaBoundsInScreen() const {
100 return drwh_ozone_->GetClientAreaBoundsInScreen();
101 }
102
103 gfx::Rect DesktopRootWindowHostOzone::GetRestoredBounds() const {
104 return drwh_ozone_->GetRestoredBounds();
105 }
106
107 gfx::Rect DesktopRootWindowHostOzone::GetWorkAreaBoundsInScreen() const {
108 return drwh_ozone_->GetWorkAreaBoundsInScreen();
109 }
110
111 void DesktopRootWindowHostOzone::SetShape(gfx::NativeRegion native_region) {
112 drwh_ozone_->SetShape(native_region);
113 }
114
115 void DesktopRootWindowHostOzone::Activate() {
116 drwh_ozone_->Activate();
117 }
118
119 void DesktopRootWindowHostOzone::Deactivate() {
120 drwh_ozone_->Deactivate();
121 }
122
123 bool DesktopRootWindowHostOzone::IsActive() const {
124 return drwh_ozone_->IsActive();
125 }
126
127 void DesktopRootWindowHostOzone::Maximize() {
128 drwh_ozone_->Maximize();
129 }
130
131 void DesktopRootWindowHostOzone::Minimize() {
132 drwh_ozone_->Minimize();
133 }
134
135 void DesktopRootWindowHostOzone::Restore() {
136 drwh_ozone_->Restore();
137 }
138
139 bool DesktopRootWindowHostOzone::IsMaximized() const {
140 return drwh_ozone_->IsMaximized();
141 }
142
143 bool DesktopRootWindowHostOzone::IsMinimized() const {
144 return drwh_ozone_->IsMinimized();
145 }
146
147 bool DesktopRootWindowHostOzone::HasCapture() const {
148 return drwh_ozone_->HasCapture();
149 }
150
151 void DesktopRootWindowHostOzone::SetAlwaysOnTop(bool always_on_top) {
152 drwh_ozone_->SetAlwaysOnTop(always_on_top);
153 }
154
155 bool DesktopRootWindowHostOzone::IsAlwaysOnTop() const {
156 return drwh_ozone_->IsAlwaysOnTop();
157 }
158
159 void DesktopRootWindowHostOzone::SetWindowTitle(const string16& title) {
160 drwh_ozone_->SetWindowTitle(title);
161 }
162
163 void DesktopRootWindowHostOzone::ClearNativeFocus() {
164 drwh_ozone_->ClearNativeFocus();
165 }
166
167 Widget::MoveLoopResult DesktopRootWindowHostOzone::RunMoveLoop(
168 const gfx::Vector2d& drag_offset,
169 Widget::MoveLoopSource source,
170 Widget::MoveLoopEscapeBehavior escape_behavior) {
171 return drwh_ozone_->RunMoveLoop(drag_offset, source, escape_behavior);
172 }
173
174 void DesktopRootWindowHostOzone::EndMoveLoop() {
175 drwh_ozone_->EndMoveLoop();
176 }
177
178 void DesktopRootWindowHostOzone::SetVisibilityChangedAnimationsEnabled(
179 bool value) {
180 drwh_ozone_->SetVisibilityChangedAnimationsEnabled(value);
181 }
182
183 bool DesktopRootWindowHostOzone::ShouldUseNativeFrame() {
184 return drwh_ozone_->ShouldUseNativeFrame();
185 }
186
187 void DesktopRootWindowHostOzone::FrameTypeChanged() {
188 drwh_ozone_->FrameTypeChanged();
189 }
190
191 NonClientFrameView* DesktopRootWindowHostOzone::CreateNonClientFrameView() {
192 return drwh_ozone_->CreateNonClientFrameView();
193 }
194
195 void DesktopRootWindowHostOzone::SetFullscreen(bool fullscreen) {
196 drwh_ozone_->SetFullscreen(fullscreen);
197 }
198
199 bool DesktopRootWindowHostOzone::IsFullscreen() const {
200 return drwh_ozone_->IsFullscreen();
201 }
202
203 void DesktopRootWindowHostOzone::SetOpacity(unsigned char opacity) {
204 drwh_ozone_->SetOpacity(opacity);
205 }
206
207 void DesktopRootWindowHostOzone::SetWindowIcons(
208 const gfx::ImageSkia& window_icon, const gfx::ImageSkia& app_icon) {
209 drwh_ozone_->SetWindowIcons(window_icon, app_icon);
210 }
211
212 void DesktopRootWindowHostOzone::InitModalType(ui::ModalType modal_type) {
213 drwh_ozone_->InitModalType(modal_type);
214 }
215
216 void DesktopRootWindowHostOzone::FlashFrame(bool flash_frame) {
217 drwh_ozone_->FlashFrame(flash_frame);
218 }
219
220 void DesktopRootWindowHostOzone::OnRootViewLayout() const {
221 drwh_ozone_->OnRootViewLayout();
222 }
223
224 void DesktopRootWindowHostOzone::OnNativeWidgetFocus() {
225 drwh_ozone_->OnNativeWidgetFocus();
226 }
227
228 void DesktopRootWindowHostOzone::OnNativeWidgetBlur() {
229 drwh_ozone_->OnNativeWidgetBlur();
230 }
231
232 bool DesktopRootWindowHostOzone::IsAnimatingClosed() const {
233 return drwh_ozone_->IsAnimatingClosed();
234 }
235
236 ////////////////////////////////////////////////////////////////////////////////
237 // DesktopRootWindowHostOzone, aura::RootWindowHost implementation:
238
239 aura::RootWindow* DesktopRootWindowHostOzone::GetRootWindow() {
240 return drwh_ozone_->GetRootWindow();
241 }
242
243 gfx::AcceleratedWidget DesktopRootWindowHostOzone::GetAcceleratedWidget() {
244 return drwh_ozone_->GetAcceleratedWidget();
245 }
246
247 void DesktopRootWindowHostOzone::Show() {
248 drwh_ozone_->Show();
249 }
250
251 void DesktopRootWindowHostOzone::Hide() {
252 drwh_ozone_->Hide();
253 }
254
255 void DesktopRootWindowHostOzone::ToggleFullScreen() {
256 drwh_ozone_->ToggleFullScreen();
257 }
258
259 gfx::Rect DesktopRootWindowHostOzone::GetBounds() const {
260 return drwh_ozone_->GetBounds();
261 }
262
263 void DesktopRootWindowHostOzone::SetBounds(const gfx::Rect& bounds) {
264 drwh_ozone_->SetBounds(bounds);
265 }
266
267 gfx::Insets DesktopRootWindowHostOzone::GetInsets() const {
268 return drwh_ozone_->GetInsets();
269 }
270
271 void DesktopRootWindowHostOzone::SetInsets(const gfx::Insets& insets) {
272 drwh_ozone_->SetInsets(insets);
273 }
274
275 gfx::Point DesktopRootWindowHostOzone::GetLocationOnNativeScreen() const {
276 return drwh_ozone_->GetLocationOnNativeScreen();
277 }
278
279 void DesktopRootWindowHostOzone::SetCapture() {
280 drwh_ozone_->SetCapture();
281 }
282
283 void DesktopRootWindowHostOzone::ReleaseCapture() {
284 drwh_ozone_->ReleaseCapture();
285 }
286
287 void DesktopRootWindowHostOzone::SetCursor(gfx::NativeCursor cursor) {
288 drwh_ozone_->SetCursor(cursor);
289 }
290
291 bool DesktopRootWindowHostOzone::QueryMouseLocation(
292 gfx::Point* location_return) {
293 return drwh_ozone_->QueryMouseLocation(location_return);
294 }
295
296 bool DesktopRootWindowHostOzone::ConfineCursorToRootWindow() {
297 return drwh_ozone_->ConfineCursorToRootWindow();
298 }
299
300 void DesktopRootWindowHostOzone::UnConfineCursor() {
301 drwh_ozone_->UnConfineCursor();
302 }
303
304 void DesktopRootWindowHostOzone::OnCursorVisibilityChanged(bool show) {
305 drwh_ozone_->OnCursorVisibilityChanged(show);
306 }
307
308 void DesktopRootWindowHostOzone::MoveCursorTo(const gfx::Point& location) {
309 drwh_ozone_->MoveCursorTo(location);
310 }
311
312 void DesktopRootWindowHostOzone::PostNativeEvent(
313 const base::NativeEvent& native_event) {
314 drwh_ozone_->PostNativeEvent(native_event);
315 }
316
317 void DesktopRootWindowHostOzone::OnDeviceScaleFactorChanged(
318 float device_scale_factor) {
319 drwh_ozone_->OnDeviceScaleFactorChanged(device_scale_factor);
320 }
321
322 void DesktopRootWindowHostOzone::PrepareForShutdown() {
323 drwh_ozone_->PrepareForShutdown();
324 }
325
326 ////////////////////////////////////////////////////////////////////////////////
327 // DesktopRootWindowHostOzone, MessageLoop::Dispatcher implementation:
328
329 bool DesktopRootWindowHostOzone::Dispatch(const base::NativeEvent& ne) {
330 return drwh_ozone_->Dispatch(ne);
331 }
332
333 ////////////////////////////////////////////////////////////////////////////////
334 // DesktopRootWindowHost, public:
335
336 // static
11 DesktopRootWindowHost* DesktopRootWindowHost::Create( 337 DesktopRootWindowHost* DesktopRootWindowHost::Create(
Elliot Glaysher 2013/11/22 18:50:05 This is confusing, and probably incorrect. This m
vignatti (out of this project) 2013/11/22 19:54:20 Done.
12 internal::NativeWidgetDelegate* native_widget_delegate, 338 internal::NativeWidgetDelegate* native_widget_delegate,
13 DesktopNativeWidgetAura* desktop_native_widget_aura) { 339 DesktopNativeWidgetAura* desktop_native_widget_aura) {
14 DesktopFactoryOzone* d_factory = DesktopFactoryOzone::GetInstance(); 340 DesktopFactoryOzone* d_factory = DesktopFactoryOzone::GetInstance();
15 341
16 return d_factory->CreateRootWindowHost(native_widget_delegate, 342 // downcast to DRWHOzone so drwh_ozone_ gets all vtable of the native
17 desktop_native_widget_aura); 343 // implementation
Elliot Glaysher 2013/11/22 18:50:05 This comment makes no sense. I have no idea what y
vignatti (out of this project) 2013/11/22 19:54:20 Done.
344 drwh_ozone_ = (DesktopRootWindowHostOzone *)
345 d_factory->CreateRootWindowHost(
346 native_widget_delegate,
347 desktop_native_widget_aura);
348
349 // upcast again
350 return drwh_ozone_;
18 } 351 }
19 352
20 } // namespace views 353 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698