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

Side by Side Diff: ui/views/widget/desktop_root_window_host_linux.cc

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes Created 8 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
« no previous file with comments | « ui/views/view_unittest.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « ui/views/view_unittest.cc ('k') | ui/views/widget/native_widget_aura.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698