From 51077acd7f613ca7bc38d61ad1d22be2233a6e15 Mon Sep 17 00:00:00 2001 From: "beng@google.com" Date: Thu, 14 Aug 2008 21:57:22 +0000 Subject: If a Window is created with specified bounds, make sure its sized to them! B=1031854 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@900 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/views/window.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'chrome/views') diff --git a/chrome/views/window.cc b/chrome/views/window.cc index 47b4444..72b365d 100644 --- a/chrome/views/window.cc +++ b/chrome/views/window.cc @@ -486,6 +486,13 @@ void Window::SetInitialFocus() { } void Window::SetInitialBounds(const gfx::Rect& create_bounds) { + // If we were created with some bounds, use those instead of trying to figure + // out the initial size from other sources. + if (!create_bounds.IsEmpty()) { + SetBounds(create_bounds); + return; + } + // Restore the window's placement from the controller. CRect saved_bounds(0, 0, 0, 0); bool maximized = false; @@ -516,7 +523,7 @@ void Window::SetInitialBounds(const gfx::Rect& create_bounds) { if (is_always_on_top_ != window_delegate_->IsAlwaysOnTop()) AlwaysOnTopChanged(); - } else if (create_bounds.IsEmpty()) { + } else { // Size the window to the content and center over the parent. SizeWindowToDefault(); } -- cgit v1.1