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

Unified Diff: ui/views/widget/native_widget_aura.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, 2 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/views/widget/desktop_root_window_host_linux.cc ('k') | ui/views/widget/root_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/native_widget_aura.cc
diff --git a/ui/views/widget/native_widget_aura.cc b/ui/views/widget/native_widget_aura.cc
index cd209c47934839a6a25d1767f59dc7025adb4e70..2ed70d2a83764c5124a9d55c59552cd344b4aa2a 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -297,13 +297,14 @@ void NativeWidgetAura::CenterWindow(const gfx::Size& size) {
work_area.set_origin(origin);
}
- parent_bounds = parent_bounds.Intersect(work_area);
+ parent_bounds.Intersect(work_area);
// If |window_|'s transient parent's bounds are big enough to fit it, then we
// center it with respect to the transient parent.
if (window_->transient_parent()) {
gfx::Rect transient_parent_rect = window_->transient_parent()->
- GetBoundsInRootWindow().Intersect(work_area);
+ GetBoundsInRootWindow();
+ transient_parent_rect.Intersect(work_area);
if (transient_parent_rect.height() >= size.height() &&
transient_parent_rect.width() >= size.width())
parent_bounds = transient_parent_rect;
@@ -316,7 +317,7 @@ void NativeWidgetAura::CenterWindow(const gfx::Size& size) {
size.height());
// Don't size the window bigger than the parent, otherwise the user may not be
// able to close or move it.
- window_bounds = window_bounds.AdjustToFit(parent_bounds);
+ window_bounds.AdjustToFit(parent_bounds);
// Convert the bounds back relative to the parent.
gfx::Point origin = window_bounds.origin();
« no previous file with comments | « ui/views/widget/desktop_root_window_host_linux.cc ('k') | ui/views/widget/root_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698