| 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 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 | 367 |
| 368 gfx::Rect window_bounds( | 368 gfx::Rect window_bounds( |
| 369 parent_bounds.x() + (parent_bounds.width() - size.width()) / 2, | 369 parent_bounds.x() + (parent_bounds.width() - size.width()) / 2, |
| 370 parent_bounds.y() + (parent_bounds.height() - size.height()) / 2, | 370 parent_bounds.y() + (parent_bounds.height() - size.height()) / 2, |
| 371 size.width(), | 371 size.width(), |
| 372 size.height()); | 372 size.height()); |
| 373 // Don't size the window bigger than the parent, otherwise the user may not be | 373 // Don't size the window bigger than the parent, otherwise the user may not be |
| 374 // able to close or move it. | 374 // able to close or move it. |
| 375 window_bounds = window_bounds.AdjustToFit(parent_bounds); | 375 window_bounds.AdjustToFit(parent_bounds); |
| 376 | 376 |
| 377 SetBounds(window_bounds); | 377 SetBounds(window_bounds); |
| 378 } | 378 } |
| 379 | 379 |
| 380 void DesktopRootWindowHostLinux::GetWindowPlacement( | 380 void DesktopRootWindowHostLinux::GetWindowPlacement( |
| 381 gfx::Rect* bounds, | 381 gfx::Rect* bounds, |
| 382 ui::WindowShowState* show_state) const { | 382 ui::WindowShowState* show_state) const { |
| 383 *bounds = bounds_; | 383 *bounds = bounds_; |
| 384 | 384 |
| 385 // TODO(erg): This needs a better implementation. For now, we're just pass | 385 // TODO(erg): This needs a better implementation. For now, we're just pass |
| (...skipping 671 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1057 DesktopRootWindowHost* DesktopRootWindowHost::Create( | 1057 DesktopRootWindowHost* DesktopRootWindowHost::Create( |
| 1058 internal::NativeWidgetDelegate* native_widget_delegate, | 1058 internal::NativeWidgetDelegate* native_widget_delegate, |
| 1059 DesktopNativeWidgetAura* desktop_native_widget_aura, | 1059 DesktopNativeWidgetAura* desktop_native_widget_aura, |
| 1060 const gfx::Rect& initial_bounds) { | 1060 const gfx::Rect& initial_bounds) { |
| 1061 return new DesktopRootWindowHostLinux(native_widget_delegate, | 1061 return new DesktopRootWindowHostLinux(native_widget_delegate, |
| 1062 desktop_native_widget_aura, | 1062 desktop_native_widget_aura, |
| 1063 initial_bounds); | 1063 initial_bounds); |
| 1064 } | 1064 } |
| 1065 | 1065 |
| 1066 } // namespace views | 1066 } // namespace views |
| OLD | NEW |