OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_root_window_host_linux.h" | 5 #include "ui/views/widget/desktop_root_window_host_linux.h" |
6 | 6 |
7 #include <X11/extensions/XInput2.h> | 7 #include <X11/extensions/XInput2.h> |
8 #include <X11/Xatom.h> | 8 #include <X11/Xatom.h> |
9 #include <X11/Xutil.h> | 9 #include <X11/Xutil.h> |
10 | 10 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 aura::RootWindow* DesktopRootWindowHostLinux::InitRootWindow( | 150 aura::RootWindow* DesktopRootWindowHostLinux::InitRootWindow( |
151 const Widget::InitParams& params) { | 151 const Widget::InitParams& params) { |
152 bounds_ = params.bounds; | 152 bounds_ = params.bounds; |
153 | 153 |
154 aura::RootWindow::CreateParams rw_params(bounds_); | 154 aura::RootWindow::CreateParams rw_params(bounds_); |
155 rw_params.host = this; | 155 rw_params.host = this; |
156 root_window_ = new aura::RootWindow(rw_params); | 156 root_window_ = new aura::RootWindow(rw_params); |
157 root_window_->Init(); | 157 root_window_->Init(); |
158 root_window_->AddChild(content_window_); | 158 root_window_->AddChild(content_window_); |
159 root_window_->SetLayoutManager(new DesktopLayoutManager(root_window_)); | 159 root_window_->SetLayoutManager(new DesktopLayoutManager(root_window_)); |
160 root_window_host_delegate_ = root_window_; | |
161 | 160 |
162 // If we're given a parent, we need to mark ourselves as transient to another | 161 // If we're given a parent, we need to mark ourselves as transient to another |
163 // window. Otherwise activation gets screwy. | 162 // window. Otherwise activation gets screwy. |
164 gfx::NativeView parent = params.GetParent(); | 163 gfx::NativeView parent = params.GetParent(); |
165 if (!params.child && params.GetParent()) | 164 if (!params.child && params.GetParent()) |
166 parent->AddTransientChild(content_window_); | 165 parent->AddTransientChild(content_window_); |
167 | 166 |
168 native_widget_delegate_->OnNativeWidgetCreated(); | 167 native_widget_delegate_->OnNativeWidgetCreated(); |
169 | 168 |
170 capture_client_.reset(new DesktopCaptureClient); | 169 capture_client_.reset(new DesktopCaptureClient); |
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 } | 551 } |
553 | 552 |
554 void DesktopRootWindowHostLinux::FlashFrame(bool flash_frame) { | 553 void DesktopRootWindowHostLinux::FlashFrame(bool flash_frame) { |
555 // TODO(erg): | 554 // TODO(erg): |
556 NOTIMPLEMENTED(); | 555 NOTIMPLEMENTED(); |
557 } | 556 } |
558 | 557 |
559 //////////////////////////////////////////////////////////////////////////////// | 558 //////////////////////////////////////////////////////////////////////////////// |
560 // DesktopRootWindowHostLinux, aura::RootWindowHost implementation: | 559 // DesktopRootWindowHostLinux, aura::RootWindowHost implementation: |
561 | 560 |
| 561 void DesktopRootWindowHostLinux::SetDelegate( |
| 562 aura::RootWindowHostDelegate* delegate) { |
| 563 root_window_host_delegate_ = delegate; |
| 564 } |
| 565 |
562 aura::RootWindow* DesktopRootWindowHostLinux::GetRootWindow() { | 566 aura::RootWindow* DesktopRootWindowHostLinux::GetRootWindow() { |
563 return root_window_; | 567 return root_window_; |
564 } | 568 } |
565 | 569 |
566 gfx::AcceleratedWidget DesktopRootWindowHostLinux::GetAcceleratedWidget() { | 570 gfx::AcceleratedWidget DesktopRootWindowHostLinux::GetAcceleratedWidget() { |
567 return xwindow_; | 571 return xwindow_; |
568 } | 572 } |
569 | 573 |
570 void DesktopRootWindowHostLinux::Show() { | 574 void DesktopRootWindowHostLinux::Show() { |
571 if (!window_mapped_) { | 575 if (!window_mapped_) { |
(...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1006 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 1010 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
1007 internal::NativeWidgetDelegate* native_widget_delegate, | 1011 internal::NativeWidgetDelegate* native_widget_delegate, |
1008 DesktopNativeWidgetAura* desktop_native_widget_aura, | 1012 DesktopNativeWidgetAura* desktop_native_widget_aura, |
1009 const gfx::Rect& initial_bounds) { | 1013 const gfx::Rect& initial_bounds) { |
1010 return new DesktopRootWindowHostLinux(native_widget_delegate, | 1014 return new DesktopRootWindowHostLinux(native_widget_delegate, |
1011 desktop_native_widget_aura, | 1015 desktop_native_widget_aura, |
1012 initial_bounds); | 1016 initial_bounds); |
1013 } | 1017 } |
1014 | 1018 |
1015 } // namespace views | 1019 } // namespace views |
OLD | NEW |