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/gtk | |
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/gtk')
-rw-r--r-- | chrome/browser/gtk/browser_titlebar.cc | 3 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.cc | 12 | ||||
-rw-r--r-- | chrome/browser/gtk/browser_window_gtk.h | 7 |
3 files changed, 8 insertions, 14 deletions
diff --git a/chrome/browser/gtk/browser_titlebar.cc b/chrome/browser/gtk/browser_titlebar.cc index 8e47ad4..d96a9a9 100644 --- a/chrome/browser/gtk/browser_titlebar.cc +++ b/chrome/browser/gtk/browser_titlebar.cc @@ -490,7 +490,8 @@ void BrowserTitlebar::MaximizeButtonClicked() { height = screen_rect.height; } - browser_window_->SetBounds(gfx::Rect(x, y, width, height)); + browser_window_->SetBounds(gfx::Rect(x, y, width, height), + BrowserWindow::WINDOW_BOUNDS); } gdk_event_free(event); } diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc index 8fdd70f..2de3b84 100644 --- a/chrome/browser/gtk/browser_window_gtk.cc +++ b/chrome/browser/gtk/browser_window_gtk.cc @@ -581,7 +581,8 @@ void BrowserWindowGtk::Show() { gtk_widget_set_size_request(contents_container_->widget(), -1, -1); } -void BrowserWindowGtk::SetBoundsImpl(const gfx::Rect& bounds, bool exterior) { +void BrowserWindowGtk::SetBounds(const gfx::Rect& bounds, + BoundsType bounds_type) { gint x = static_cast<gint>(bounds.x()); gint y = static_cast<gint>(bounds.y()); gint width = static_cast<gint>(bounds.width()); @@ -589,7 +590,7 @@ void BrowserWindowGtk::SetBoundsImpl(const gfx::Rect& bounds, bool exterior) { gtk_window_move(window_, x, y); - if (exterior) { + if (bounds_type == WINDOW_BOUNDS) { SetWindowSize(window_, width, height); } else { gtk_widget_set_size_request(contents_container_->widget(), @@ -597,10 +598,6 @@ void BrowserWindowGtk::SetBoundsImpl(const gfx::Rect& bounds, bool exterior) { } } -void BrowserWindowGtk::SetBounds(const gfx::Rect& bounds) { - SetBoundsImpl(bounds, true); -} - void BrowserWindowGtk::Close() { // We're already closing. Do nothing. if (!window_) @@ -1395,7 +1392,8 @@ void BrowserWindowGtk::SetGeometryHints() { if (browser_->bounds_overridden()) { // For popups, bounds are set in terms of the client area rather than the // entire window. - SetBoundsImpl(bounds, !(browser_->type() & Browser::TYPE_POPUP)); + SetBounds(bounds, (browser_->type() & Browser::TYPE_POPUP) ? + BrowserWindow::CONTENT_BOUNDS : BrowserWindow::WINDOW_BOUNDS); } else { // Ignore the position but obey the size. SetWindowSize(window_, bounds.width(), bounds.height()); diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h index 69805c7..1cbfab0 100644 --- a/chrome/browser/gtk/browser_window_gtk.h +++ b/chrome/browser/gtk/browser_window_gtk.h @@ -48,7 +48,7 @@ class BrowserWindowGtk : public BrowserWindow, // 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; @@ -247,11 +247,6 @@ class BrowserWindowGtk : public BrowserWindow, // Save the window position in the prefs. void SaveWindowPosition(); - // Set the bounds of the current window. If |exterior| is true, set the size - // of the window itself, otherwise set the bounds of the web contents. In - // either case, set the position of the window. - void SetBoundsImpl(const gfx::Rect& bounds, bool exterior); - // Callback for when the custom frame alignment needs to be redrawn. // The content area includes the toolbar and web page but not the tab strip. static gboolean OnCustomFrameExpose(GtkWidget* widget, GdkEventExpose* event, |