diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-14 21:57:22 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-08-14 21:57:22 +0000 |
commit | 51077acd7f613ca7bc38d61ad1d22be2233a6e15 (patch) | |
tree | 07422041cafc0296f9c4739e4185d3aa9a7ef5a7 /chrome/views | |
parent | bcc642aea480bd35180824e693779f83377f95d6 (diff) | |
download | chromium_src-51077acd7f613ca7bc38d61ad1d22be2233a6e15.zip chromium_src-51077acd7f613ca7bc38d61ad1d22be2233a6e15.tar.gz chromium_src-51077acd7f613ca7bc38d61ad1d22be2233a6e15.tar.bz2 |
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
Diffstat (limited to 'chrome/views')
-rw-r--r-- | chrome/views/window.cc | 9 |
1 files changed, 8 insertions, 1 deletions
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(); } |