diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-02 17:41:44 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-02 17:41:44 +0000 |
commit | 078a10a1c64458e5f5c4fdf57edbbc935dd145ca (patch) | |
tree | ac6514112513237e157d5fa859509750bc022872 /chrome/browser/views/frame | |
parent | 799185ae9f4d034fd11b052cd3ff7ed1e12c10c2 (diff) | |
download | chromium_src-078a10a1c64458e5f5c4fdf57edbbc935dd145ca.zip chromium_src-078a10a1c64458e5f5c4fdf57edbbc935dd145ca.tar.gz chromium_src-078a10a1c64458e5f5c4fdf57edbbc935dd145ca.tar.bz2 |
Fix browser side handling of moveTo by resizing the content area; not the window.
BUG=27365
TEST=none
Review URL: http://codereview.chromium.org/661187
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@40386 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/frame')
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 17 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.h | 2 |
2 files changed, 16 insertions, 3 deletions
diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index aab1ac8..7e7aece 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -691,8 +691,21 @@ void BrowserView::Show() { frame_->GetWindow()->Show(); } -void BrowserView::SetBounds(const gfx::Rect& bounds) { - GetWidget()->SetBounds(bounds); +void BrowserView::SetBounds(const gfx::Rect& bounds, BoundsType bounds_type) { + gfx::Rect new_bounds = bounds; + if (bounds_type == CONTENT_BOUNDS) { + // Caluclate how much larger the window needs to be to accomidate |bounds|. + gfx::Rect container_bounds = contents_container_->bounds(); + int width_offset = bounds.width() - container_bounds.width(); + int height_offset = bounds.height() - container_bounds.height(); + + gfx::Rect win_bounds; + GetWidget()->GetBounds(&win_bounds, true); + new_bounds.set_width(win_bounds.width() + width_offset); + new_bounds.set_height(win_bounds.height() + height_offset); + } + + GetWidget()->SetBounds(new_bounds); } void BrowserView::Close() { diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index 1cf958f..f2d1978 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -238,7 +238,7 @@ class BrowserView : public BrowserBubbleHost, // Overridden from BrowserWindow: virtual void Show(); - virtual void SetBounds(const gfx::Rect& bounds); + virtual void SetBounds(const gfx::Rect& bounds, BoundsType bounds_type); virtual void Close(); virtual void Activate(); virtual bool IsActive() const; |