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

Side by Side Diff: views/desktop/desktop_window_view.cc

Issue 7464027: Wayland support for views. views_desktop on Wayland. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Updated files to latest and fixed changes for dependent CLs Created 9 years, 4 months 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "views/desktop/desktop_window_view.h" 5 #include "views/desktop/desktop_window_view.h"
6 6
7 #include "ui/gfx/canvas.h" 7 #include "ui/gfx/canvas.h"
8 #include "ui/gfx/transform.h" 8 #include "ui/gfx/transform.h"
9 #include "views/desktop/desktop_background.h" 9 #include "views/desktop/desktop_background.h"
10 #include "views/desktop/desktop_window_root_view.h" 10 #include "views/desktop/desktop_window_root_view.h"
11 #include "views/layer_property_setter.h" 11 #include "views/layer_property_setter.h"
12 #include "views/widget/native_widget_view.h" 12 #include "views/widget/native_widget_view.h"
13 #include "views/widget/native_widget_views.h" 13 #include "views/widget/native_widget_views.h"
14 #include "views/widget/widget.h" 14 #include "views/widget/widget.h"
15 #include "views/window/native_frame_view.h" 15 #include "views/window/native_frame_view.h"
16 16
17 #if defined(OS_WIN) 17 #if defined(OS_WIN)
18 #include "views/widget/native_widget_win.h" 18 #include "views/widget/native_widget_win.h"
19 #elif defined(USE_WAYLAND)
20 #include "views/widget/native_widget_wayland.h"
19 #elif defined(TOOLKIT_USES_GTK) 21 #elif defined(TOOLKIT_USES_GTK)
20 #include "views/widget/native_widget_gtk.h" 22 #include "views/widget/native_widget_gtk.h"
21 #endif 23 #endif
22 24
23 namespace views { 25 namespace views {
24 namespace desktop { 26 namespace desktop {
25 27
26 // The Widget that hosts the DesktopWindowView. Subclasses Widget to override 28 // The Widget that hosts the DesktopWindowView. Subclasses Widget to override
27 // CreateRootView() so that the DesktopWindowRootView can be supplied instead 29 // CreateRootView() so that the DesktopWindowRootView can be supplied instead
28 // for custom event filtering. 30 // for custom event filtering.
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
129 desktop_window_view->widget_ = window; 131 desktop_window_view->widget_ = window;
130 132
131 views::Widget::InitParams params; 133 views::Widget::InitParams params;
132 params.delegate = desktop_window_view; 134 params.delegate = desktop_window_view;
133 // In this environment, CreateChromeWindow will default to creating a views- 135 // In this environment, CreateChromeWindow will default to creating a views-
134 // window, so we need to construct a NativeWidgetWin by hand. 136 // window, so we need to construct a NativeWidgetWin by hand.
135 // TODO(beng): Replace this with NativeWindow::CreateNativeRootWindow(). 137 // TODO(beng): Replace this with NativeWindow::CreateNativeRootWindow().
136 #if defined(OS_WIN) 138 #if defined(OS_WIN)
137 params.native_widget = new views::NativeWidgetWin(window); 139 params.native_widget = new views::NativeWidgetWin(window);
138 params.bounds = gfx::Rect(20, 20, 1920, 1200); 140 params.bounds = gfx::Rect(20, 20, 1920, 1200);
141 #elif defined(USE_WAYLAND)
142 params.native_widget = new views::NativeWidgetWayland(window);
139 #elif defined(TOOLKIT_USES_GTK) 143 #elif defined(TOOLKIT_USES_GTK)
140 params.native_widget = new views::NativeWidgetGtk(window); 144 params.native_widget = new views::NativeWidgetGtk(window);
141 #endif 145 #endif
142 window->Init(params); 146 window->Init(params);
143 window->Show(); 147 window->Show();
144 window->Maximize(); 148 window->Maximize();
145 } 149 }
146 150
147 void DesktopWindowView::ActivateWidget(Widget* widget) { 151 void DesktopWindowView::ActivateWidget(Widget* widget) {
148 if (widget && widget->IsActive()) 152 if (widget && widget->IsActive())
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 active_native_widget_->GetWidget()->Deactivate(); 272 active_native_widget_->GetWidget()->Deactivate();
269 active_native_widget_ = 273 active_native_widget_ =
270 static_cast<NativeWidgetViews*>(widget->native_widget()); 274 static_cast<NativeWidgetViews*>(widget->native_widget());
271 } else if (widget == active_native_widget_->GetWidget()) { 275 } else if (widget == active_native_widget_->GetWidget()) {
272 active_native_widget_ = NULL; 276 active_native_widget_ = NULL;
273 } 277 }
274 } 278 }
275 279
276 } // namespace desktop 280 } // namespace desktop
277 } // namespace views 281 } // namespace views
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698