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

Unified Diff: ui/views/widget/native_widget_aura.cc

Issue 10795078: Fixes two bugs related to constrained windows: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
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 ea9555b28576a6e2876523fb0ec343117e63c63f..1b2b5135f117827db6358ff476e60880d6cea2a4 100644
--- a/ui/views/widget/native_widget_aura.cc
+++ b/ui/views/widget/native_widget_aura.cc
@@ -359,7 +359,7 @@ void NativeWidgetAura::CenterWindow(const gfx::Size& size) {
aura::client::GetScreenPositionClient(window_->GetRootWindow());
if (screen_position_client) {
gfx::Point origin = work_area.origin();
- screen_position_client->ConvertPointFromScreen(window_->parent(),
+ screen_position_client->ConvertPointFromScreen(window_->GetRootWindow(),
&origin);
work_area.set_origin(origin);
}
@@ -381,7 +381,9 @@ void NativeWidgetAura::CenterWindow(const gfx::Size& size) {
parent_bounds.y() + (parent_bounds.height() - size.height()) / 2,
size.width(),
size.height());
- window_bounds = window_bounds.AdjustToFit(work_area);
+ // 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);
// Convert the bounds back relative to the parent.
gfx::Point origin = window_bounds.origin();
« no previous file with comments | « chrome/browser/ui/views/constrained_web_dialog_delegate_views.cc ('k') | ui/views/widget/native_widget_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698